X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/037585db3933a2954b43bd4b30ea5e30ade00be2..823f6b4d3621521603b66d8e09859dd87821348c:/app/models/user_block.rb diff --git a/app/models/user_block.rb b/app/models/user_block.rb index de14dcaa9..edea23c80 100644 --- a/app/models/user_block.rb +++ b/app/models/user_block.rb @@ -26,6 +26,12 @@ class UserBlock < ActiveRecord::Base needs_view || ends_at > Time.now.getutc end + ## + # returns true if the block is a "zero hour" block + def zero_hour? + needs_view && (ends_at.to_i == updated_at.to_i) + end + ## # revokes the block, allowing the user to use the API again. the argument # is the user object who is revoking the ban.