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

Tom Hughes notifications at github.com
Sat Feb 18 14:54:38 UTC 2017


tomhughes requested changes 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)

Do the times really need to be converted to integers before comparing them?

>          set_locale
-        report_error t("application.setup_user_auth.blocked"), :forbidden
+        if  @user.blocks.active.take.zero_hour?

What was the point of creating `user_block` if you're then not going to use it ;-)

-- 
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#pullrequestreview-22639236
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20170218/d50bdaf4/attachment.html>


More information about the rails-dev mailing list