mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Use confirmed_at as flag.
This commit is contained in:
parent
9c5ff02ff1
commit
eca511a8f2
1 changed files with 3 additions and 4 deletions
|
@ -45,7 +45,7 @@ module Devise
|
|||
|
||||
# Verifies whether a user is confirmed or not
|
||||
def confirmed?
|
||||
persisted? && !confirmed_at.nil?
|
||||
!!confirmed_at
|
||||
end
|
||||
|
||||
# Send confirmation instructions by email
|
||||
|
@ -75,15 +75,14 @@ module Devise
|
|||
# If you don't want confirmation to be sent on create, neither a code
|
||||
# to be generated, call skip_confirmation!
|
||||
def skip_confirmation!
|
||||
self.confirmed_at = Time.now
|
||||
@skip_confirmation = true
|
||||
self.confirmed_at = Time.now
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
# Callback to overwrite if confirmation is required or not.
|
||||
def confirmation_required?
|
||||
!@skip_confirmation
|
||||
!confirmed?
|
||||
end
|
||||
|
||||
# Checks if the confirmation for the user is within the limit time.
|
||||
|
|
Loading…
Reference in a new issue