blob: 8816dd8076bb7c0121411f60208f0bef56c97bf4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
# frozen_string_literal: true
class REST::FilterSerializer < ActiveModel::Serializer
attributes :id, :title, :context, :expires_at, :filter_action
has_many :keywords, serializer: REST::FilterKeywordSerializer, if: :rules_requested?
has_many :statuses, serializer: REST::FilterStatusSerializer, if: :rules_requested?
def id
object.id.to_s
end
def rules_requested?
instance_options[:rules_requested]
end
end
|