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
challah-0.5.2 vendor/bundle/gems/railties-3.2.2/guides/code/getting_started/app/models/post.rb
challah-0.5.2 vendor/bundle/gems/railties-3.2.1/guides/code/getting_started/app/models/post.rb
challah-0.5.1 vendor/bundle/gems/railties-3.2.2/guides/code/getting_started/app/models/post.rb
railties-3.2.2 guides/code/getting_started/app/models/post.rb
railties-3.2.2.rc1 guides/code/getting_started/app/models/post.rb
challah-0.5.0 vendor/bundle/gems/railties-3.2.1/guides/code/getting_started/app/models/post.rb
challah-0.4.1 vendor/bundle/gems/railties-3.2.1/guides/code/getting_started/app/models/post.rb
challah-0.4.0 vendor/bundle/gems/railties-3.2.1/guides/code/getting_started/app/models/post.rb
challah-0.3.5 vendor/bundle/gems/railties-3.2.1/guides/code/getting_started/app/models/post.rb
challah-0.3.4 vendor/bundle/gems/railties-3.2.1/guides/code/getting_started/app/models/post.rb
challah-0.3.3 vendor/bundle/gems/railties-3.2.1/guides/code/getting_started/app/models/post.rb
challah-0.3.2 vendor/bundle/gems/railties-3.2.1/guides/code/getting_started/app/models/post.rb
challah-0.3.1 vendor/bundle/gems/railties-3.2.1/guides/code/getting_started/app/models/post.rb
challah-0.3.0 vendor/bundle/gems/railties-3.2.1/guides/code/getting_started/app/models/post.rb
challah-0.2.1 vendor/bundle/gems/railties-3.2.1/guides/code/getting_started/app/models/post.rb
challah-0.2.0 vendor/bundle/gems/railties-3.2.1/guides/code/getting_started/app/models/post.rb
railties-3.2.1 guides/code/getting_started/app/models/post.rb
railties-3.2.0 guides/code/getting_started/app/models/post.rb
railties-3.2.0.rc2 guides/code/getting_started/app/models/post.rb
railties-3.2.0.rc1 guides/code/getting_started/app/models/post.rb