创建comment
This commit is contained in:
parent
e149b1e12d
commit
edc538062b
|
@ -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 }
|
||||||
|
|
Loading…
Reference in New Issue