Files
nairobi/app/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-03-14 17:25:43 +01:00
2019-07-29 13:10:09 +02:00
2019-06-12 16:23:40 +02:00
2019-08-08 18:49:13 +02:00
2017-11-17 13:14:03 -04:00
2019-06-27 09:19:37 +02:00
2019-05-28 14:26:18 +02:00
2019-03-27 15:22:14 +01:00
2019-04-17 17:40:56 +02:00
2019-08-27 17:22:22 +02:00
2019-03-14 17:25:43 +01:00
2019-04-29 13:08:43 -05:00
2019-04-17 17:40:56 +02:00
2019-05-28 14:26:18 +02:00
2019-06-27 09:19:35 +02:00
2019-08-28 20:32:40 +02:00
2019-05-22 11:50:03 +02:00
2019-07-29 13:10:09 +02:00
2019-03-14 17:25:43 +01:00
2019-02-05 17:41:00 +01:00
2019-06-12 16:23:40 +02:00
2019-05-31 15:43:06 +02:00
2017-12-15 19:21:02 +01:00