-
- PERIODS = [0, 1, 3, 6, 12, 24, 48, 96]
+
+ PERIODS = USER_BLOCK_PERIODS
+
+ ##
+ # scope to match active blocks
+ def self.active
+ where("needs_view or ends_at > ?", Time.now.getutc)
+ end
+
+ ##
+ # return a renderable version of the reason text.
+ def reason
+ RichText.new(self[:reason_format], self[:reason])
+ end