comment.rb
6 lines
| 237 B
| text/x-ruby
|
RubyLexer
|
r78 | 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 | ||||