Files
nairobi/spec/models
Javi Martín c574a4d93a Fix DirectMessage.today on different time zones
The dates are saved on UTC times on the database. So, for example,
if living in West Australia, `Date.current.beginning_of_day` will be
stored as UTC's yesterday at 15:15:00, while `Date.current.end_of_day`
will be stored as UTC's today at 15:14:59.

When we use the `DATE` database function, PostgreSQL will select the
records with the same UTC date as the current UTC date. However, we need
the records with the same application date (as defined in
`config.time_zone`) as the current application date. The test passed
(for us) because we were using `beginning_of_day + 3.hours` to make sure
we were creating records when the date in Madrid was the same as the UTC
date.

Using a ruby interval for the time condition solves the problem.
2019-08-28 20:32:40 +02:00
..
2019-08-28 20:32:40 +02:00
2019-03-27 15:22:14 +01:00
2019-04-30 12:00:54 +02:00
2019-05-31 18:22:59 +02:00
2019-03-27 15:22:14 +01:00
2019-01-18 14:17:12 +01:00
2019-06-27 09:21:18 +02:00
2019-07-29 13:10:09 +02:00
2019-08-28 20:32:40 +02:00
2019-06-03 18:35:59 +02:00