Class: Workers::CleanupOldExports

Inherits:
Base
  • Object
show all
Defined in:
app/workers/cleanup_old_exports.rb

Instance Method Summary collapse

Instance Method Details

#performObject


7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/workers/cleanup_old_exports.rb', line 7

def perform
  User.where("exported_at < ?", 14.days.ago).each do |user|
    user.remove_export = true
    user.exported_at = nil
    user.save
  end

  User.where("exported_photos_at < ?", 14.days.ago).each do |user|
    user.remove_exported_photos_file = true
    user.exported_photos_at = nil
    user.save
  end
end