[openstreetmap/openstreetmap-website] Add functionality to return a specific message for zero hour blocks (#1443)
notifications at github.com
Sat Feb 18 15:19:10 UTC 2017
tomhughes commented on this pull request.
> @@ -27,6 +27,12 @@ def active?
+ # returns true if the block is a "zero hour" block
+ def zero_hour?
+ needs_view && (ends_at.to_i == updated_at.to_i)
That's because `ends_at` is set by the controller by `created_at` and `updated_at` are either set by rails when the object is saved or by the database - not sure which. In any case truncation to seconds is not going to work if we happen to roll over a second boundary between the two...
Is `needs_view` not what you really want to check?
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rails-dev