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

Simon Poole notifications at github.com
Sat Feb 18 16:04:17 UTC 2017

simonpoole 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)

If I understand things correctly we have roughly three cases that we care about

1. needs_view set, duration of block ~0 -> "zero hour block"
2. needs_view set, duration of block >> 0 -> longish block were we still want to communicate to the user
3. needs_view not set -> no messaging to the user

Currently all three cases get the same message. With this PR (1) gets a slightly friendlier message than (2) and (3), but we could further differentiate these if we wanted to ie remove the reference to having to log in.

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...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20170218/c5ca9f1a/attachment.html>

More information about the rails-dev mailing list