views:

18

answers:

1

So I'm going to switch from Authlogic to Devise. Since I only have a couple of test accounts, I thought it would be best to simply remove all the Authlogic stuff and my users table, then setup Devise. I'm using Rails 3. Apart from removing authlogic from my gemfile, removing the user and user_session models/tables, is there anything else I need to do?

A: 

Yo,

when using devise with all modules your User table should look like this :

 id                   | integer                     | not null default nextval('contributors_id_seq'::regclass)
 email                | character varying(255)      | not null default ''::character varying
 encrypted_password   | character varying(128)      | not null default ''::character varying
 password_salt        | character varying(255)      | not null default ''::character varying
 confirmation_token   | character varying(255)      | 
 confirmed_at         | timestamp without time zone | 
 confirmation_sent_at | timestamp without time zone | 
 reset_password_token | character varying(255)      | 
 remember_token       | character varying(255)      | 
 remember_created_at  | timestamp without time zone | 
 sign_in_count        | integer                     | default 0
 current_sign_in_at   | timestamp without time zone | 
 last_sign_in_at      | timestamp without time zone | 
 current_sign_in_ip   | character varying(255)      | 
 last_sign_in_ip      | character varying(255)      | 
 failed_attempts      | integer                     | default 0
 unlock_token         | character varying(255)      | 
 locked_at            | timestamp without time zone | 
 created_at           | timestamp without time zone | 
 updated_at           | timestamp without time zone | 

You will have to write a migration to add/rename the columns.

The great thing is that you can change the default encrytor to the one used by Authlogic so you'll be able to migrate smoothly all your existing users...

See : http://github.com/plataformatec/devise/blob/master/lib/devise/encryptors/authlogic_sha512.rb

You can change the encryptor in devise initializer :

config.encryptor = :authlogic_sha512

That should be all :).

slainer68