gitlab-org--gitlab-foss/app/serializers/label_entity.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
411 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class LabelEntity < Grape::Entity
expose :id
2017-07-07 12:54:49 +00:00
expose :title
expose :color do |label|
label.color.to_s
end
expose :description
expose :group_id
expose :project_id
expose :template
2017-05-05 22:47:32 +00:00
expose :text_color
expose :created_at
expose :updated_at
2018-12-03 15:23:38 +00:00
expose :priority, if: -> (*) { options.key?(:project) } do |label|
label.priority(options[:project])
end
end