Ensure both times are UTC when validating the confirmation period

The fact that we're setting them value as UTC doesn't necessarily mean
we're gonna get it back as UTC, so ensure both are converted to compare.
This commit is contained in:
Carlos Antonio da Silva 2017-03-15 10:22:01 -03:00
parent a665aada25
commit bacd9d244c
1 changed files with 1 additions and 1 deletions

View File

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