Remove IP tracking columns from users table (#16409)
This commit is contained in:
parent
b52fdb4c6f
commit
8e84ebf0cb
19 changed files with 141 additions and 75 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue