List the "Watching First Post" tags on preferences

This commit is contained in:
Robin Ward
2016-07-22 16:16:45 -04:00
parent 944b2aabfe
commit b2289d733f
5 changed files with 46 additions and 32 deletions

View File

@@ -84,6 +84,7 @@ class UserSerializer < BasicUserSerializer
private_attributes :locale,
:muted_category_ids,
:watched_tags,
:watching_first_post_tags,
:tracked_tags,
:muted_tags,
:tracked_category_ids,
@@ -258,6 +259,10 @@ class UserSerializer < BasicUserSerializer
TagUser.lookup(object, :tracking).joins(:tag).pluck('tags.name')
end
def watching_first_post_tags
TagUser.lookup(object, :watching_first_post).joins(:tag).pluck('tags.name')
end
def watched_tags
TagUser.lookup(object, :watching).joins(:tag).pluck('tags.name')
end