mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: UserProfileView: Do not log IP of logged-in users
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
class UserProfileView < ActiveRecord::Base
|
||||
validates_presence_of :user_profile_id, :ip_address, :viewed_at
|
||||
validates_presence_of :user_profile_id, :viewed_at
|
||||
|
||||
belongs_to :user_profile
|
||||
|
||||
@@ -9,6 +9,7 @@ class UserProfileView < ActiveRecord::Base
|
||||
if user_id
|
||||
return if user_id < 1
|
||||
redis_key << ":user-#{user_id}"
|
||||
ip = nil
|
||||
else
|
||||
redis_key << ":ip-#{ip}"
|
||||
end
|
||||
@@ -59,13 +60,12 @@ end
|
||||
# id :integer not null, primary key
|
||||
# user_profile_id :integer not null
|
||||
# viewed_at :datetime not null
|
||||
# ip_address :inet not null
|
||||
# ip_address :inet
|
||||
# user_id :integer
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_user_profile_views_on_user_id (user_id)
|
||||
# index_user_profile_views_on_user_profile_id (user_profile_id)
|
||||
# unique_profile_view_ip (viewed_at,ip_address,user_profile_id) UNIQUE
|
||||
# unique_profile_view_user (viewed_at,user_id,user_profile_id) UNIQUE
|
||||
# unique_profile_view_user_or_ip (viewed_at,user_id,ip_address,user_profile_id) UNIQUE
|
||||
#
|
||||
|
Reference in New Issue
Block a user