Open chadwilken opened 8 years ago
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 initializers/001_sorcery.rb
and initializers/002_rails_admin.rb
is't that bad it clearly suggest what needs to be loaded first
@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: