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
|