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