diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-01-16 22:39:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-16 22:39:35 +0100 |
commit | a85912b0d6d2ee68aa35794fbb51c5358768c092 (patch) | |
tree | af0dde21359576102ab8dcf8a1dc3342f67bb71c /app/serializers/rest/admin/account_serializer.rb | |
parent | 07cb948f39464b11959fc506b673a90d9524e519 (diff) | |
parent | 278bd61d6f507e56350e7f14caaeaa954700ecd8 (diff) |
Merge pull request #1659 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/serializers/rest/admin/account_serializer.rb')
-rw-r--r-- | app/serializers/rest/admin/account_serializer.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/app/serializers/rest/admin/account_serializer.rb b/app/serializers/rest/admin/account_serializer.rb index f579d3302..3480e8c5a 100644 --- a/app/serializers/rest/admin/account_serializer.rb +++ b/app/serializers/rest/admin/account_serializer.rb @@ -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 |