Class: EgovUtils::ArchiveUsers
- Inherits:
-
Object
- Object
- EgovUtils::ArchiveUsers
- Defined in:
- app/services/egov_utils/archive_users.rb
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'app/services/egov_utils/archive_users.rb', line 3 def call EgovUtils::User .where.not(days_before_archive: nil, active: true).each do |user| date_to_compare = user.last_login_at || user.created_at next if date_to_compare > Time.now - user.days_before_archive.days user.destroy end end |