Skip to content

Instantly share code, notes, and snippets.

@romariorios
Created October 27, 2009 04:24
Show Gist options
  • Save romariorios/219317 to your computer and use it in GitHub Desktop.
Save romariorios/219317 to your computer and use it in GitHub Desktop.
class Post < ActiveRecord::Base
belongs_to :post
has_many :replies, :class_name => "Post"
validates_length_of :title, :maximum => 32, :allow_nil => false, :allow_blank => false, :too_short => "Please, enter a title.", :too_long => "Title is too long. Enter a shorter title."
validates_length_of :text, :maximum => 10240, :allow_nil => false, :allow_blank => false, :too_short => "Please, enter a text", :too_long => "Text is too long. Enter a shorter text."
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment