aboutsummaryrefslogtreecommitdiffstats
path: root/guides/code/getting_started/app/models/post.rb
diff options
context:
space:
mode:
Diffstat (limited to 'guides/code/getting_started/app/models/post.rb')
-rw-r--r--guides/code/getting_started/app/models/post.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/guides/code/getting_started/app/models/post.rb b/guides/code/getting_started/app/models/post.rb
new file mode 100644
index 0000000000..21387340b0
--- /dev/null
+++ b/guides/code/getting_started/app/models/post.rb
@@ -0,0 +1,6 @@
+class Post < ActiveRecord::Base
+ validates :title, :presence => true,
+ :length => { :minimum => 5 }
+
+ has_many :comments, :dependent => :destroy
+end