2 # Redaction represents a record associated with a particular
3 # action on the database to hide revisions from the history
4 # which are not appropriate to redistribute any more.
6 # The circumstances of the redaction can be recorded in the
7 # record's title and description fields, which can be
8 # displayed linked from the redacted records.
10 class Redaction < ActiveRecord::Base
15 has_many :old_relations
17 after_initialize :set_defaults
19 # this method overrides the AR default to provide the rich
20 # text object for the description field.
22 RichText.new(read_attribute(:description_format), read_attribute(:description))
27 # set the default format to be markdown, in the absence of
30 self.description_format = "markdown" unless self.attribute_present?(:description_format)