Don't error if resource doesn't need confirming

This commit is contained in:
Andy Geers 2015-04-01 12:41:37 +01:00
parent d22ac4a4fb
commit 8a8887ea82
1 changed files with 1 additions and 1 deletions

View File

@ -216,7 +216,7 @@ module Devise
# confirmation_period_expired? # will always return false
#
def confirmation_period_expired?
self.class.confirm_within && (Time.now > self.confirmation_sent_at + self.class.confirm_within)
self.class.confirm_within && self.confirmation_sent_at && (Time.now > self.confirmation_sent_at + self.class.confirm_within)
end
# Checks whether the record requires any confirmation.