diff --git a/lib/devise/models/confirmable.rb b/lib/devise/models/confirmable.rb index 01d35c75..076922d4 100644 --- a/lib/devise/models/confirmable.rb +++ b/lib/devise/models/confirmable.rb @@ -178,7 +178,7 @@ module Devise # Checks whether the record requires any confirmation. def pending_any_confirmation - if !confirmation_period_expired? && (!confirmed? || pending_reconfirmation?) + unless confirmation_period_expired? || (confirmed? && !pending_reconfirmation?) yield else # TODO: cache this call or not? diff --git a/lib/generators/templates/devise.rb b/lib/generators/templates/devise.rb index b681b3f0..dcc0a368 100644 --- a/lib/generators/templates/devise.rb +++ b/lib/generators/templates/devise.rb @@ -97,7 +97,7 @@ Devise.setup do |config| # within 3 days after the mail was sent, but on the fourth day their account can't be # confirmed with the token any more # Default is nil, meaning there is no restriction on how long a user can take before - # comfirming their account. + # confirming their account. # config.expire_confirmation_token_after = 3.days # If true, requires any email changes to be confirmed (exactly the same way as diff --git a/test/models/confirmable_test.rb b/test/models/confirmable_test.rb index 3e7196d1..1013aebc 100644 --- a/test/models/confirmable_test.rb +++ b/test/models/confirmable_test.rb @@ -236,7 +236,7 @@ class ConfirmableTest < ActiveSupport::TestCase end end - def confirm_user_by_token_with_confirmation_sent_at confirmation_sent_at + def confirm_user_by_token_with_confirmation_sent_at(confirmation_sent_at) user = create_user user.confirmation_sent_at = confirmation_sent_at confirmed_user = User.confirm_by_token(user.confirmation_token)