I’m trying to override the method ‘send_confirmation_instructions’ as shown here:
http://trackingrails.com/posts/devise-send-confirmation-mail-manually-or-delay-them
with:
def send_confirmation_instructions
generate_confirmation_token! if self.confirmation_token.nil?
::Devise.mailer.delay.confirmation_instructions(self)
end
This seems to no longer work with the latest version of devise. The devise docs show how to override a controller but not a model. Any suggestions on how to override a devise model? Thanks
When you set up Devise, you tell it which model it’s working on (e.g. User); many/most of its methods then apply to that class. So that’s where you’ll want to override stuff.
Here’s a comment from the Devise code at
lib/devise/models/authenticatable.rbthat describes almost exactly what you want to do, if I am reading correctly.