Override active_for_authentication? for development

Where can I put this to override active_for_authentication?

def active_for_authentication? super && account_active? end 

1) Location of file name and file.

2) how the full file will look .. with etc. class something <<devise: something

Original function active_for_authentication? the method can be found in dev / lib / devise / models / authenticatable.rb.

Thank you

+7
source share
1 answer

Overwrite active_for_authentication? method active_for_authentication? in your model [...] - Source

So, if you have a User model, you just need to do

 class User def active_for_authentication? super && account_active? end end 
+14
source

All Articles