From 7f05783949ce561d58904da133efd37438ebffe8 Mon Sep 17 00:00:00 2001 From: Simon Poole Date: Sat, 18 Feb 2017 17:05:36 +0100 Subject: [PATCH] Make test for a "zero hour" block more robust --- app/models/user_block.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/user_block.rb b/app/models/user_block.rb index edea23c80..eb0daba65 100644 --- a/app/models/user_block.rb +++ b/app/models/user_block.rb @@ -29,7 +29,8 @@ class UserBlock < ActiveRecord::Base ## # returns true if the block is a "zero hour" block def zero_hour? - needs_view && (ends_at.to_i == updated_at.to_i) + # if the times differ more than 1 minute we probably have more important issues + needs_view && (ends_at.to_i - updated_at.to_i) < 60 end ## -- 2.43.2