FIX: Group#mentionable and Group#messageable not fully working.

This commit is contained in:
Guo Xiang Tan
2017-10-02 16:50:27 +08:00
parent 4ae3a4e89e
commit 91c5f928c2
5 changed files with 16 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
class GroupShowSerializer < BasicGroupSerializer
attributes :is_group_user, :is_group_owner, :mentionable
attributes :is_group_user, :is_group_owner, :mentionable, :messageable
def include_is_group_user?
authenticated?
@@ -21,6 +21,10 @@ class GroupShowSerializer < BasicGroupSerializer
authenticated?
end
def include_messageable?
authenticated?
end
def mentionable
Group.mentionable(scope.user).exists?(id: object.id)
end