Skip to content

Commit

Permalink
Fix rubocop "where range"
Browse files Browse the repository at this point in the history
  • Loading branch information
Splines committed Aug 13, 2024
1 parent 50055d1 commit c9a3ca2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/models/user_cleaner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ class UserCleaner
# Users without a last_sign_in_at date are also considered inactive. This is
# the case for users who have never logged in since PR #553 was merged.
def inactive_users
User.where("last_sign_in_at < ?", INACTIVE_USER_THRESHOLD.ago)
User.where(last_sign_in_at: ...INACTIVE_USER_THRESHOLD.ago)
.or(User.where(last_sign_in_at: nil))
end

# Returns all users who have been active in the last INACTIVE_USER_THRESHOLD months,
# i.e. their last sign-in date is less than INACTIVE_USER_THRESHOLD months ago.
def active_users
User.where("last_sign_in_at >= ?", INACTIVE_USER_THRESHOLD.ago)
User.where(last_sign_in_at: INACTIVE_USER_THRESHOLD.ago..)
end

# Sets the deletion date for inactive users and sends an initial warning mail.
Expand Down Expand Up @@ -98,7 +98,7 @@ def unset_deletion_date_for_recently_active_users
def delete_users_according_to_deletion_date!
num_deleted_users = 0

User.where("deletion_date <= ?", Date.current).find_each do |user|
User.where(deletion_date: ..Date.current).find_each do |user|
next unless user.generic?

UserCleanerMailer.with(user: user).deletion_email.deliver_later
Expand Down

0 comments on commit c9a3ca2

Please sign in to comment.