class Comment < ActiveRecord::Base
  belongs_to :user
  belongs_to :song

  validates_presence_of :content, :song_id, :user_id
  # This checks to make sure that the comment is not retardedly short.
  validates_length_of :content, 
                      :within => 10..500, :too_long => "Comment is too long. Maximum number of characters is 500.", 
                                          :too_short => "Comment is too short. Please post something worthwhile!"

  named_scope :on_song, lambda { |id| { :conditions => { :song_id => id}}}
end
