BUGFIX: muted categories showing up in new via message bus

This commit is contained in:
Sam
2014-06-18 11:21:40 +10:00
parent 9007d96466
commit fed8f7c6f2
3 changed files with 17 additions and 2 deletions

View File

@@ -22,7 +22,8 @@ class CurrentUserSerializer < BasicUserSerializer
:should_be_redirected_to_top,
:redirected_to_top_reason,
:disable_jump_reply,
:custom_fields
:custom_fields,
:muted_category_ids
def include_site_flagged_posts_count?
object.staff?
@@ -93,4 +94,10 @@ class CurrentUserSerializer < BasicUserSerializer
end
end
def muted_category_ids
@muted_category_ids ||= CategoryUser.where(user_id: object.id,
notification_level: TopicUser.notification_levels[:muted])
.pluck(:category_id)
end
end