X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/aa4205482a4af317ec26fc686793b57f02a6864a..e316f0e425cc934295c8e64cdcf03f00899f287c:/app/models/user_block.rb diff --git a/app/models/user_block.rb b/app/models/user_block.rb index 8821926bb..2cf0eefc4 100644 --- a/app/models/user_block.rb +++ b/app/models/user_block.rb @@ -9,6 +9,12 @@ class UserBlock < ActiveRecord::Base PERIODS = USER_BLOCK_PERIODS + ## + # scope to match active blocks + def self.active + self.where("needs_view or ends_at > ?", Time.now.getutc) + end + ## # return a renderable version of the reason text. def reason