about summary refs log tree commit diff
path: root/app/controllers/concerns/user_tracking_concern.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-01-16 22:39:35 +0100
committerGitHub <noreply@github.com>2022-01-16 22:39:35 +0100
commita85912b0d6d2ee68aa35794fbb51c5358768c092 (patch)
treeaf0dde21359576102ab8dcf8a1dc3342f67bb71c /app/controllers/concerns/user_tracking_concern.rb
parent07cb948f39464b11959fc506b673a90d9524e519 (diff)
parent278bd61d6f507e56350e7f14caaeaa954700ecd8 (diff)
Merge pull request #1659 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/controllers/concerns/user_tracking_concern.rb')
-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