mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
BUGFIX: broken like expansion
This commit is contained in:
parent
4b611f87e9
commit
f733d5532f
2 changed files with 5 additions and 7 deletions
|
@ -5,12 +5,6 @@ class BasicUserSerializer < ApplicationSerializer
|
|||
SiteSetting.enable_names?
|
||||
end
|
||||
|
||||
# so weird we send a hash in here sometimes and an object others
|
||||
def include_uploaded_avatar_id?
|
||||
SiteSetting.allow_uploaded_avatars? &&
|
||||
(Hash === object ? user[:uploaded_avatar_id] : object.uploaded_avatar_id)
|
||||
end
|
||||
|
||||
def avatar_template
|
||||
if Hash === object
|
||||
User.avatar_template(user[:username], user[:uploaded_avatar_id])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class PostActionUserSerializer < BasicUserSerializer
|
||||
attributes :id, :username, :avatar_template, :post_url
|
||||
attributes :post_url
|
||||
|
||||
def id
|
||||
object.user.id
|
||||
|
@ -9,6 +9,10 @@ class PostActionUserSerializer < BasicUserSerializer
|
|||
object.user.username
|
||||
end
|
||||
|
||||
def uploaded_avatar_id
|
||||
object.user.uploaded_avatar_id
|
||||
end
|
||||
|
||||
def avatar_template
|
||||
object.user.avatar_template
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue