mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Add a location field to a user's profile
This commit is contained in:
@@ -9,6 +9,7 @@ class UserSerializer < BasicUserSerializer
|
||||
:created_at,
|
||||
:website,
|
||||
:profile_background,
|
||||
:location,
|
||||
:can_edit,
|
||||
:can_edit_username,
|
||||
:can_edit_email,
|
||||
@@ -113,6 +114,13 @@ class UserSerializer < BasicUserSerializer
|
||||
scope.can_edit_name?(object)
|
||||
end
|
||||
|
||||
def location
|
||||
object.user_profile.try(:location)
|
||||
end
|
||||
def include_location?
|
||||
location.present?
|
||||
end
|
||||
|
||||
def stats
|
||||
UserAction.stats(object.id, scope)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user