Class: CleanTokensJob

Inherits:
ApplicationJob show all
Defined in:
app/jobs/clean_tokens_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(*args) ⇒ Object



4
5
6
7
# File 'app/jobs/clean_tokens_job.rb', line 4

def perform(*args)
  Token.where(active: false).where('updated_at < ?', 1.month.ago).delete_all
  Token.where('last_used < ?', 1.year.ago).delete_all
end