Class: FlaggedTopicSummarySerializer

Inherits:
ActiveModel::Serializer show all
Defined in:
app/serializers/flagged_topic_summary_serializer.rb

Instance Method Summary collapse

Methods inherited from ActiveModel::Serializer

#include!

Instance Method Details

#flag_countsObject



12
13
14
15
16
# File 'app/serializers/flagged_topic_summary_serializer.rb', line 12

def flag_counts
  object.flag_counts.map do |k, v|
    { post_action_type_id: k, count: v, name_key: PostActionType.types[k] }
  end
end

#idObject



8
9
10
# File 'app/serializers/flagged_topic_summary_serializer.rb', line 8

def id
  topic.id
end

#last_flag_atObject



22
23
24
# File 'app/serializers/flagged_topic_summary_serializer.rb', line 22

def last_flag_at
  object.last_flag_at
end

#user_idsObject



18
19
20
# File 'app/serializers/flagged_topic_summary_serializer.rb', line 18

def user_ids
  object.user_ids
end