+
+ 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