2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-01-03 12:03:01 -05:00
|
|
|
class ReviewableBundledActionSerializer < ApplicationSerializer
|
|
|
|
attributes :id, :icon, :label
|
|
|
|
has_many :actions, serializer: ReviewableActionSerializer, root: "actions"
|
|
|
|
|
|
|
|
def label
|
2019-04-17 11:26:43 -04:00
|
|
|
I18n.t(object.label, default: nil)
|
|
|
|
end
|
|
|
|
|
|
|
|
def include_label?
|
|
|
|
label.present?
|
|
|
|
end
|
|
|
|
|
|
|
|
def include_icon?
|
|
|
|
icon.present?
|
2019-01-03 12:03:01 -05:00
|
|
|
end
|
|
|
|
end
|