aboutsummaryrefslogtreecommitdiffstats
path: root/guides/code/getting_started/app/models/post.rb
blob: 64e0d721fd7254fb831d789efdf57a607e5364c2 (plain) (blame)
1
2
3
4
5
6
7
class Post < ActiveRecord::Base
  has_many :comments, dependent: :destroy
  
  validates :title,
    presence: true,
    length: { minimum: 5 }
end