【发布时间】:2016-07-27 18:07:49
【问题描述】:
我将ruby-on-rails-5 与devise 和devise-token-auth 一起使用。
我在我的用户模型中做了这个并且效果很好:
before_create :skip_confirmation!
# Include default devise modules.
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
我能够创建帐户,并自动确认。 对于其他内容,我需要通过将以下内容添加到我的 application.rb 来更改应用程序的时区。
config.time_zone = 'Europe/Berlin'
config.active_record.default_timezone = 'Europe/Berlin'
时区的东西也可以,但由于未知原因,创建用户停止了。如果我创建一个并尝试登录,则会出现此错误:
A confirmation email was sent to your account at '...'. You must follow the instructions in the email before your account can be activated
在使用新时区创建帐户后,在我的数据库中,用户记录的每个时间戳值都已正确插入(使用新时区)。
我该如何解决这个问题?
【问题讨论】:
标签: ruby-on-rails-5 devise ruby-on-rails devise devise-confirmable