因此,我将从Authlogic切换到Devise。由于我只有几个测试帐户,因此我认为最好先删除所有Authlogic内容和我的用户表,然后设置Devise。我正在使用Rails3。除了从我的gemfile中删除authlogic,删除user和user_session模型/表之外,还有什么需要做的吗?

最佳答案



与所有模块一起使用devise时,您的User表应如下所示:

 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 |


您将必须编写迁移来添加/重命名列。

很棒的是,您可以将默认加密程序更改为Authlogic使用的加密程序,这样您就可以顺利迁移所有现有用户...

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

您可以在devise初始值设定项中更改加密器:

config.encryptor = :authlogic_sha512


那应该是全部:)。

关于ruby-on-rails - 我一直在使用Authlogic,但现在需要删除它的所有痕迹。我需要做什么?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/4050700/

10-11 03:40