]> git.openstreetmap.org Git - rails.git/blob - app/models/changeset_comment.rb
Load banner config from config/banners.yml
[rails.git] / app / models / changeset_comment.rb
1 class ChangesetComment < ActiveRecord::Base
2   belongs_to :changeset
3   belongs_to :author, :class_name => "User"
4
5   validates :id, :uniqueness => true, :presence => { :on => :update },
6                  :numericality => { :on => :update, :integer_only => true }
7   validates :changeset, :presence => true, :associated => true
8   validates :author, :presence => true, :associated => true
9   validates :visible, :inclusion => [true, false]
10   validates :body, :format => /\A[^\x00-\x08\x0b-\x0c\x0e-\x1f\x7f\ufffe\uffff]*\z/
11
12   # Return the comment text
13   def body
14     RichText.new("text", self[:body])
15   end
16 end