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