【发布时间】:2015-04-16 20:29:34
【问题描述】:
我知道以前有人问过这个问题,但没有一个答案对我有帮助。
我有以下情况。
- 我安装了设计(一切正常)
-
想要包含确认邮件,所以我愿意
- 包括:在用户模型中可确认
- 取消注释我的迁移文件中的相关行(请参阅下面的整个文件)。
- 运行 rake db:migrate(并重新启动服务器)
当我现在尝试注册时,我得到“” X 的未定义局部变量或方法 `confirmed_at'....
我在这里错过了什么?
类 DeviseCreateUsers
## Recoverable
t.string :reset_password_token
t.datetime :reset_password_sent_at
## Rememberable
t.datetime :remember_created_at
## Trackable
t.integer :sign_in_count, default: 0, null: false
t.datetime :current_sign_in_at
t.datetime :last_sign_in_at
t.string :current_sign_in_ip
t.string :last_sign_in_ip
## Confirmable
t.string :confirmation_token
t.datetime :confirmed_at
t.datetime :confirmation_sent_at
t.string :unconfirmed_email # Only if using reconfirmable
## Lockable
# t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
# t.string :unlock_token # Only if unlock strategy is :email or :both
# t.datetime :locked_at
t.timestamps
end
add_index :users, :email, unique: true
add_index :users, :reset_password_token, unique: true
add_index :users, :confirmation_token, unique: true
# add_index :users, :unlock_token, unique: true
结束 结束
【问题讨论】:
-
我不确定,但其中的代码是
t.confirmable丢失或可能存在具有相同文件名的相同迁移,因此请尝试添加不同名称的迁移文件
标签: ruby-on-rails ruby