创建comment

This commit is contained in:
yafei Lee 2012-06-24 07:04:32 +08:00
parent e149b1e12d
commit edc538062b
1 changed files with 3 additions and 0 deletions

View File

@ -7,6 +7,9 @@ class Post
field :title, :type => String field :title, :type => String
field :content, :type => String field :content, :type => String
field :type, :type=> String field :type, :type=> String
field :visited_count, :type=>Integer, :default=>0
has_many :comments
validates :title, :presence=>true, :uniqueness=> true validates :title, :presence=>true, :uniqueness=> true
validates :content, :presence=>true, :length => { :minimum=> 30 } validates :content, :presence=>true, :length => { :minimum=> 30 }