I’ve previously implemented Authlogic for authorization on my site. Now however I wish to switch over to using Devise instead, and I’m wondering if anyone has any experience with this. Perhaps anyone’s seen a blog post on the subject?
Thank you.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I myself switched from Authlogic to Devise recently and also didn’t find any articles. However, in the simple case, once you’ve thrown away all of your user_session and other authlogic-related code, the main piece of work is converting your old users table to the format expected by devise.
My old table looked like this:
and I determined that the table would have to contain at least the following info for devise (with many optional features enabled):
So I defined an unadorned activerecord class in the migration class
and then here’s the “up” migration code I ended up using (with PostgreSQL):
Note that here I’ve converted a plain password column into a bcrypt-encrypted column for Devise — if you’ve used encrypted passwords with Authlogic, then you’ll probably want to just rename the column (if necessary) and choose the correct encryptor module in
config/initializers/devise.rb.For reference, the “devise” clause in my User model looks like this:
Note that overriding
:authentication_keyslike this so that users sign in with their login rather than their email address required me to modify some of the devise views:rails generate devise:views, then edit the files.Hope this helps a bit. Good luck!