Refactored according to line notes by rodrigoflores
This commit is contained in:
parent
87f2fa9767
commit
42a0c30139
|
@ -178,7 +178,7 @@ module Devise
|
||||||
|
|
||||||
# Checks whether the record requires any confirmation.
|
# Checks whether the record requires any confirmation.
|
||||||
def pending_any_confirmation
|
def pending_any_confirmation
|
||||||
if !confirmation_period_expired? && (!confirmed? || pending_reconfirmation?)
|
unless confirmation_period_expired? || (confirmed? && !pending_reconfirmation?)
|
||||||
yield
|
yield
|
||||||
else
|
else
|
||||||
# TODO: cache this call or not?
|
# TODO: cache this call or not?
|
||||||
|
|
|
@ -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
|
# within 3 days after the mail was sent, but on the fourth day their account can't be
|
||||||
# confirmed with the token any more
|
# confirmed with the token any more
|
||||||
# Default is nil, meaning there is no restriction on how long a user can take before
|
# 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
|
# config.expire_confirmation_token_after = 3.days
|
||||||
|
|
||||||
# If true, requires any email changes to be confirmed (exactly the same way as
|
# If true, requires any email changes to be confirmed (exactly the same way as
|
||||||
|
|
|
@ -236,7 +236,7 @@ class ConfirmableTest < ActiveSupport::TestCase
|
||||||
end
|
end
|
||||||
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 = create_user
|
||||||
user.confirmation_sent_at = confirmation_sent_at
|
user.confirmation_sent_at = confirmation_sent_at
|
||||||
confirmed_user = User.confirm_by_token(user.confirmation_token)
|
confirmed_user = User.confirm_by_token(user.confirmation_token)
|
||||||
|
|
Loading…
Reference in New Issue