Class: ClearConversationsJob
- Inherits:
-
ActiveJob::Base
- Object
- ActiveJob::Base
- ClearConversationsJob
- Defined in:
- lib/generators/wit_bot/clear_conversations_job/templates/job.rb
Instance Method Summary collapse
Instance Method Details
#perform ⇒ Object
4 5 6 7 |
# File 'lib/generators/wit_bot/clear_conversations_job/templates/job.rb', line 4 def perform # Find all conversations not updated in the last 4 hours, and destroy them. Conversation.where{ updated_at <= 4.hours.ago }.destroy_all end |