mirror of
https://github.com/discourse/discourse.git
synced 2026-08-14 06:55:03 -05:00
FEATURE: Track user profile views.
This commit is contained in:
@@ -65,7 +65,8 @@ class UserSerializer < BasicUserSerializer
|
||||
:custom_fields,
|
||||
:user_fields,
|
||||
:topic_post_count,
|
||||
:pending_count
|
||||
:pending_count,
|
||||
:profile_view_count
|
||||
|
||||
has_one :invited_by, embed: :object, serializer: BasicUserSerializer
|
||||
has_many :custom_groups, embed: :object, serializer: BasicGroupSerializer
|
||||
@@ -346,4 +347,8 @@ class UserSerializer < BasicUserSerializer
|
||||
0
|
||||
end
|
||||
|
||||
def profile_view_count
|
||||
object.user_profile.views
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user