Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
model can not override find_first_by_auth_conditions if 1) request_keys option is set AND 2) two devise models are present #2285
Slightly obtuse bug I found when a user was using my reset password feature after I implemented something like this (https://github.com/plataformatec/devise/wiki/How-To:--Isolate-users-to-log-into-a-single-subdomain). It seems my query was not scoping to my subdomains correctly for non "authentication" flow queries.
When you have two devise models (such as Admin and User), and you have the request_keys set, any model overrides of find_first_by_auth_conditions will be ignored.
Here is a sample application illustrating my problem:
When you run the test as is, it fails.
If you comment out the request_keys call in user.rb, it passes, as you would expect.
I'd be happy to help with a fix. However even though spent lots of time trying to figure what was the cause, I don't understand why it is happening. :)
Thank you for making Devise awesome!