Sha256: d79db0296251885cd0df9d1986359b842298f983a34a724524bc24e4a662445e

Contents?: true

Size: 358 Bytes

Versions: 160

Compression:

Stored size: 358 Bytes

Contents

class Post < ActiveRecord::Base
  validates :name,  :presence => true
  validates :title, :presence => true,
                    :length => { :minimum => 5 }
 
  has_many :comments, :dependent => :destroy
  has_many :tags
 
  accepts_nested_attributes_for :tags, :allow_destroy => :true,
    :reject_if => proc { |attrs| attrs.all? { |k, v| v.blank? } }
end

Version data entries

160 entries across 121 versions & 19 rubygems

Version Path
railties-3.2.22.5 guides/code/getting_started/app/models/post.rb
railties-3.2.22.4 guides/code/getting_started/app/models/post.rb
railties-3.2.22.3 guides/code/getting_started/app/models/post.rb
railties-3.2.22.2 guides/code/getting_started/app/models/post.rb
railties-3.2.22.1 guides/code/getting_started/app/models/post.rb
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/guides/code/getting_started/app/models/post.rb
railties-3.2.22 guides/code/getting_started/app/models/post.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/railties-3.2.12/guides/code/getting_started/app/models/post.rb
railties-3.2.21 guides/code/getting_started/app/models/post.rb
railties-3.2.20 guides/code/getting_started/app/models/post.rb
railties-3.2.19 guides/code/getting_started/app/models/post.rb
railties-3.2.18 guides/code/getting_started/app/models/post.rb
railties-3.2.17 guides/code/getting_started/app/models/post.rb
railties-3.2.16 guides/code/getting_started/app/models/post.rb
railties-3.2.15 guides/code/getting_started/app/models/post.rb
railties-3.2.15.rc3 guides/code/getting_started/app/models/post.rb
railties-3.2.15.rc2 guides/code/getting_started/app/models/post.rb
railties-3.2.15.rc1 guides/code/getting_started/app/models/post.rb
railties-3.2.14 guides/code/getting_started/app/models/post.rb
railties-3.2.14.rc2 guides/code/getting_started/app/models/post.rb