[openstreetmap/openstreetmap-website] Add functionality to return a specific message for zero hour blocks (#1443)

Simon Poole notifications at github.com
Sat Feb 18 15:26:05 UTC 2017


simonpoole commented on this pull request.



> @@ -27,6 +27,12 @@ def active?
   end
 
   ##
+  # returns true if the block is a "zero hour" block
+  def zero_hour?
+    needs_view && (ends_at.to_i == updated_at.to_i)

"Is needs_view not what you really want to check?" I believe that is essentially always set by the DWG, including longer blocks. It isn't an indicator of  the block being a zero hour one,  I suppose testing if ends_at.to_i - updated_at.to_i is smaller than a suitable value should be robust enough.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/1443#discussion_r101895057
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20170218/ff99fb85/attachment.html>


More information about the rails-dev mailing list