更改电子邮件资源.pending_reconfirmation?不再适用于导轨4

时间:2013-10-30 09:56:12

标签: ruby-on-rails devise ruby-on-rails-4 confirmation

升级到rails 4后,

我有问题
resource.pending_reconfirmation?

在注册#edit view中我有:

  - if devise_mapping.confirmable? && resource.pending_reconfirmation?
    %div
      Currently waiting confirmation for: #{resource.unconfirmed_email}.
      %br
      Please click the link in the email to confirm
  .ruler

似乎是devise_mapping.confirmable? == true但是在电子邮件更改资源后才正确.pending_reconfirmation?保持虚假。

为什么会发生这种情况以及如何解决?

1 个答案:

答案 0 :(得分:1)

如果发现resource.pending_reconfirmation存在问题?以及试图使用的字段。我用这个来证明这一点:

  - if devise_mapping.confirmable? && (not resource.confirmed?)
    %div
      Currently waiting confirmation for: #{resource.email}.
      %br
      Please click the link in the email to confirm
  .ruler