1
0
Fork 0
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:
José Valim 2010-07-08 08:21:14 +02:00
parent 9c5ff02ff1
commit eca511a8f2

View file

@ -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.