1 class MapBugComment < ActiveRecord::Base
2 set_table_name 'map_bug_comment'
4 belongs_to :map_bug, :foreign_key => :bug_id
5 belongs_to :author, :class_name => "User", :foreign_key => :author_id
7 validates_inclusion_of :event, :in => [ "opened", "closed", "reopened", "commented", "hidden" ]
8 validates_presence_of :id, :on => :update
9 validates_uniqueness_of :id
10 validates_presence_of :visible
13 if self.author_id.nil?
14 self.read_attribute(:author_name)
16 self.author.display_name