Report abuse

class Comment < ActiveRecord::Base
  belongs_to :commentable, :polymorphic => true, :counter_cache => true
  belongs_to :user
  has_and_belongs_to_many :related, :join_table => 'related_comments',
                        :foreign_key => 'first_comment_id',
                        :association_foreign_key => 'second_comment_id',
                        :class_name => 'Comment'

  validates_presence_of :body
  validates_length_of :body, :maximum => 25000

end