comments can now be added on news. git-svn-id: http://redmine.rubyforge.org/svn/trunk@81 e93f8b46-1217-0410-a6f0-8f06a7374b81
7 lines
237 B
Ruby
7 lines
237 B
Ruby
class Comment < ActiveRecord::Base
|
|
belongs_to :commented, :polymorphic => true, :counter_cache => true
|
|
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
|
|
|
|
validates_presence_of :commented, :author, :comment
|
|
end
|