0
0
Fork 0

Remove IP tracking columns from users table (#16409)

This commit is contained in:
Eugen Rochko 2022-01-16 13:23:50 +01:00 committed by GitHub
parent b52fdb4c6f
commit 8e84ebf0cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 141 additions and 75 deletions

View file

@ -9,6 +9,7 @@ class REST::Admin::AccountSerializer < ActiveModel::Serializer
attribute :created_by_application_id, if: :created_by_application?
attribute :invited_by_account_id, if: :invited?
has_many :ips, serializer: REST::Admin::IpSerializer
has_one :account, serializer: REST::AccountSerializer
def id
@ -19,10 +20,6 @@ class REST::Admin::AccountSerializer < ActiveModel::Serializer
object.user_email
end
def ip
object.user_current_sign_in_ip.to_s.presence
end
def role
object.user_role
end
@ -74,4 +71,12 @@ class REST::Admin::AccountSerializer < ActiveModel::Serializer
def created_by_application?
object.user&.created_by_application_id&.present?
end
def ips
object.user&.ips
end
def ip
ips&.first
end
end