FIX: Move check to right serializer.
This commit is contained in:
parent
d3a409456f
commit
793f933b6b
|
@ -1,10 +1,6 @@
|
||||||
class BasicUserSerializer < ApplicationSerializer
|
class BasicUserSerializer < ApplicationSerializer
|
||||||
attributes :id, :username, :avatar_template
|
attributes :id, :username, :avatar_template
|
||||||
|
|
||||||
def include_name?
|
|
||||||
SiteSetting.enable_names?
|
|
||||||
end
|
|
||||||
|
|
||||||
def avatar_template
|
def avatar_template
|
||||||
if Hash === object
|
if Hash === object
|
||||||
User.avatar_template(user[:username], user[:uploaded_avatar_id])
|
User.avatar_template(user[:username], user[:uploaded_avatar_id])
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
class GroupPostUserSerializer < BasicUserSerializer
|
class GroupPostUserSerializer < BasicUserSerializer
|
||||||
attributes :title, :name
|
attributes :title, :name
|
||||||
|
|
||||||
|
def include_name?
|
||||||
|
SiteSetting.enable_names?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue