UX: Show category badge on enqueued posts

This commit is contained in:
Robin Ward
2015-04-15 15:29:37 -04:00
parent 9ffec28076
commit d2ed64751e
6 changed files with 41 additions and 14 deletions
+11 -1
View File
@@ -9,9 +9,19 @@ class QueuedPostSerializer < ApplicationSerializer
:rejected_by_id,
:raw,
:post_options,
:created_at
:created_at,
:category_id
has_one :user, serializer: BasicUserSerializer, embed: :object
has_one :topic, serializer: BasicTopicSerializer
def category_id
cat_id = object.topic.try(:category_id) || object.post_options['category']
cat_id.to_i if cat_id
end
def include_category_id?
category_id.present?
end
end