]> git.openstreetmap.org Git - rails.git/blob - app/models/changeset_comment.rb
Merge branch 'master' into overpass
[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_presence_of :id, :on => :update # is it necessary?
6   validates_uniqueness_of :id
7   validates_presence_of :changeset
8   validates_associated :changeset
9   validates_presence_of :author
10   validates_associated :author
11   validates :visible, :inclusion => { :in => [true,false] }
12   
13   # Return the comment text
14   def body
15     RichText.new("text", read_attribute(:body))
16   end
17 end