debian-mirror-gitlab/app/serializers/label_entity.rb

20 lines
421 B
Ruby
Raw Normal View History

2018-11-18 11:00:15 +05:30
# frozen_string_literal: true
2017-08-17 22:00:37 +05:30
class LabelEntity < Grape::Entity
2017-09-10 17:25:29 +05:30
expose :id, if: ->(label, _) { !label.is_a?(GlobalLabel) }
2017-08-17 22:00:37 +05:30
expose :title
expose :color
expose :description
expose :group_id
expose :project_id
expose :template
expose :text_color
expose :created_at
expose :updated_at
2019-02-15 15:39:39 +05:30
expose :priority, if: -> (*) { options.key?(:project) } do |label|
label.priority(options[:project])
end
2017-08-17 22:00:37 +05:30
end