]> git.openstreetmap.org Git - rails.git/blob - app/models/redaction.rb
Change cursor to 'move' when hovering routing markers
[rails.git] / app / models / redaction.rb
1 ##
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.
5 #
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.
9 #
10 class Redaction < ActiveRecord::Base
11   belongs_to :user
12
13   has_many :old_nodes
14   has_many :old_ways
15   has_many :old_relations
16
17   validates :description, :presence => true
18   validates :description_format, :inclusion => { :in => %w(text html markdown) }
19
20   # this method overrides the AR default to provide the rich
21   # text object for the description field.
22   def description
23     RichText.new(self[:description_format], self[:description])
24   end
25 end