Home > database >  Delete registration after 24 hours if not confirmed (Rails, Devise)
Delete registration after 24 hours if not confirmed (Rails, Devise)

Time:02-23

Is there a way, maybe implemented and not seen by me, or somehow for gem 'Devise', to remove registrations of users that haven't confirmed their account for 24 hours?

CodePudding user response:

Create your own async task and use Whenever to plan it every minute to scope your users with something like

User.where(confirmed_at: nil).where('created_at < ?', 1.day.ago).destroy_all
  • Related