Always use Time.current (aliases internally to Time.zone.now)

Some specs where breaking close to midnight because 30.years.ago uses zone.now and Time.now.utc.to_date doesn't.
Also this will make all codebase consistent in the way time is deal with
This commit is contained in:
Bertocq
2017-05-24 07:54:48 +02:00
parent 72facb8e65
commit 9e74249b02
5 changed files with 10 additions and 10 deletions

View File

@@ -50,10 +50,10 @@ class Poll
if dob.blank?
nil
else
now = Time.now.utc.to_date
now = Time.current.to_date
now.year - dob.year - ((now.month > dob.month || (now.month == dob.month && now.day >= dob.day)) ? 0 : 1)
end
end
end
end
end