Got rid of some inline WP properties

pull/1556/head
Marek Takac 10 years ago
parent 01a3454dd6
commit 74a600bb18
  1. 14
      lib/api/v3/work_packages/work_package_representer.rb

@ -86,20 +86,6 @@ module API
property :version_name, getter: -> (*) { work_package.fixed_version.try(:name) }, render_nil: true
property :project_id, getter: -> (*) { work_package.project.id }
property :project_name, getter: -> (*) { work_package.project.try(:name) }
property :responsible_id, getter: -> (*) { work_package.responsible.try(:id) }, render_nil: true
property :responsible_name, getter: -> (*) { work_package.responsible.try(:name) }, render_nil: true
property :responsible_login, getter: -> (*) { work_package.responsible.try(:login) }, render_nil: true
property :responsible_mail, getter: -> (*) { work_package.responsible.try(:mail) }, render_nil: true
property :responsible_avatar, getter: -> (*) { gravatar_image_url(work_package.responsible.try(:mail)) }, render_nil: true
property :assigned_to_id, as: :assigneeId, getter: -> (*) { work_package.assigned_to.try(:id) }, render_nil: true
property :assignee_name, getter: -> (*) { work_package.assigned_to.try(:name) }, render_nil: true
property :assignee_login, getter: -> (*) { work_package.assigned_to.try(:login) }, render_nil: true
property :assignee_mail, getter: -> (*) { work_package.assigned_to.try(:mail) }, render_nil: true
property :assignee_avatar, getter: -> (*) { gravatar_image_url(work_package.assigned_to.try(:mail)) }, render_nil: true
property :author_name, getter: -> (*) { work_package.author.name }, render_nil: true
property :author_login, getter: -> (*) { work_package.author.login }, render_nil: true
property :author_mail, getter: -> (*) { work_package.author.mail }, render_nil: true
property :author_avatar, getter: -> (*) { gravatar_image_url(work_package.author.try(:mail)) }, render_nil: true
property :created_at, getter: -> (*) { work_package.created_at.utc.iso8601}, render_nil: true
property :updated_at, getter: -> (*) { work_package.updated_at.utc.iso8601}, render_nil: true

Loading…
Cancel
Save