X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/aa4205482a4af317ec26fc686793b57f02a6864a..1f7dd79daf44de5f8f8b6c246a269e44bb258175:/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