Permalink
Browse files

Add validation for post

  • Loading branch information...
yannr77 committed Jan 26, 2012
1 parent b6c9ed2 commit 5ea7da18eb4394f3c0840e314f3252112f88043c
Showing with 2 additions and 0 deletions.
  1. +2 −0 app/models/post.rb
View
@@ -1,2 +1,4 @@
class Post < ActiveRecord::Base
+ validates :name, :presence => true
+ validates :title, :presence => true, :length => { :minimum => 5 }
end

0 comments on commit 5ea7da1

Please sign in to comment.