summaryrefslogtreecommitdiffstats
path: root/app/models/comment.rb
blob: 1ec7db630f8a6d8680c0bd65874782257dd00d4c (plain)
1
2
3
4
5
6
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