【发布时间】:2011-06-24 16:02:56
【问题描述】:
我在我的应用程序中使用 rails 3 和 Devise 1.3.4 进行身份验证。
生成用户模型后,我尝试将更多设计模块添加到我的 devise_create_users.rb 迁移文件,但出现错误:
ActiveRecord::ConnectionAdapters::TableDefinition 的未定义方法 `timeoutable'。
但是,添加其他模块,例如 :confirmable 就可以了。
devise_create_user.rb:
create_table(:users) do |t|
t.database_authenticatable :null => false
t.recoverable
t.rememberable
t.trackable
t.timeoutable
# t.encryptable
t.confirmable
# t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
# t.token_authenticatable
t.timestamps
end
我的用户模型:
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable, :confirmable , :timeoutable
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me
end
任何想法可能是什么错误?
【问题讨论】:
标签: ruby-on-rails devise