-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sorcery ActiveRecord Adapter always uses email attribute #762
Comments
So it turns out if you use this in combination with rails_admin and modify the class in an initializer it will load the model class before sorcery can configure the properties and caused the error above. For the time being I removed my rails admin config. |
@chadwilken maybe simply loading the sorcery config before rails admin config is a solution? I think they're loaded alphabetically, so just rename one of them. That's far from perfect, but maybe having files like |
@arnvald not a bad idea as it is clear that one precedes the other. Ill mess with it a bit later. |
@arnvald I gave it a try and now it complains that the password reset mailer must be provided. It is set but the module must not be loaded even if I add a require at the top. |
I haven't changed any sorcery or user related code for a while but all of a sudden Sorcery is always trying to use the
email
attribute when performingfind_by
. My config is below and I confirmed that the configuration is being loaded. Not sure if you might have a solution for this other than adding analias_attribute
on theUser
class. I didn't update the gem just simply ran tests and it magically started failing. I attempted to remove the gem and reinstall to no change.Update
After some digging with Byebug, I have confirmed in the
find_by_credentials
method that it is gettingemail
from the call to find_by_credentials. The output if I see what thesorcery_config
has is:My config file:
The text was updated successfully, but these errors were encountered: