From f2331ef07f527b58f980e461edf79041ce6f64f1 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Tue, 27 Aug 2019 13:07:03 +0100 Subject: [PATCH] DEV: Stop serializing user_auth_token_logs (#8043) These are no longer used in the user interface --- app/serializers/user_serializer.rb | 12 +----------- test/javascripts/fixtures/user_fixtures.js.es6 | 14 -------------- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/app/serializers/user_serializer.rb b/app/serializers/user_serializer.rb index 0379feede45..43c038ba046 100644 --- a/app/serializers/user_serializer.rb +++ b/app/serializers/user_serializer.rb @@ -120,8 +120,7 @@ class UserSerializer < BasicUserSerializer :mailing_list_posts_per_day, :can_change_bio, :user_api_keys, - :user_auth_tokens, - :user_auth_token_logs + :user_auth_tokens untrusted_attributes :bio_raw, :bio_cooked, @@ -210,15 +209,6 @@ class UserSerializer < BasicUserSerializer ) end - def user_auth_token_logs - ActiveModel::ArraySerializer.new( - object.user_auth_token_logs.where( - action: UserAuthToken::USER_ACTIONS - ).order(:created_at).reverse_order, - each_serializer: UserAuthTokenLogSerializer - ) - end - def bio_raw object.user_profile.bio_raw end diff --git a/test/javascripts/fixtures/user_fixtures.js.es6 b/test/javascripts/fixtures/user_fixtures.js.es6 index e8a42c3d569..e68bb101ebe 100644 --- a/test/javascripts/fixtures/user_fixtures.js.es6 +++ b/test/javascripts/fixtures/user_fixtures.js.es6 @@ -2380,7 +2380,6 @@ export default { can_change_bio: true, user_api_keys: null, user_auth_tokens: [], - user_auth_token_logs: [], invited_by: null, groups: [ { @@ -2677,19 +2676,6 @@ export default { is_active: true } ], - user_auth_token_logs: [ - { - id: 4, - client_ip: "127.0.0.1", - location: "unknown", - browser: "Google Chrome", - device: "GNU/Linux Computer", - os: "Linux", - icon: "fab-linux", - created_at: "2019-06-26T08:41:18.448Z", - action: "Log In" - } - ], invited_by: null, groups: [ {