about summary refs log tree commit diff
path: root/app/controllers/concerns
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-01-16 13:23:50 +0100
committerGitHub <noreply@github.com>2022-01-16 13:23:50 +0100
commit8e84ebf0cb211c1d94145399b05c9f2ad0e4d4b0 (patch)
treeebd30c6287a50f6b8c21700b8a3000c4f45070a1 /app/controllers/concerns
parentb52fdb4c6f28b6f09861f1bc856079bb60391055 (diff)
Remove IP tracking columns from users table (#16409)
Diffstat (limited to 'app/controllers/concerns')
-rw-r--r--app/controllers/concerns/user_tracking_concern.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/concerns/user_tracking_concern.rb b/app/controllers/concerns/user_tracking_concern.rb
index efda37fae..45f3aab0d 100644
--- a/app/controllers/concerns/user_tracking_concern.rb
+++ b/app/controllers/concerns/user_tracking_concern.rb
@@ -3,7 +3,7 @@
 module UserTrackingConcern
   extend ActiveSupport::Concern
 
-  UPDATE_SIGN_IN_HOURS = 24
+  UPDATE_SIGN_IN_FREQUENCY = 24.hours.freeze
 
   included do
     before_action :update_user_sign_in
@@ -12,10 +12,10 @@ module UserTrackingConcern
   private
 
   def update_user_sign_in
-    current_user.update_sign_in!(request) if user_needs_sign_in_update?
+    current_user.update_sign_in! if user_needs_sign_in_update?
   end
 
   def user_needs_sign_in_update?
-    user_signed_in? && (current_user.current_sign_in_at.nil? || current_user.current_sign_in_at < UPDATE_SIGN_IN_HOURS.hours.ago)
+    user_signed_in? && (current_user.current_sign_in_at.nil? || current_user.current_sign_in_at < UPDATE_SIGN_IN_FREQUENCY.ago)
   end
 end