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.7.0.pre vendor/bundle/gems/railties-3.2.7/guides/code/getting_started/app/models/post.rb
railties-3.2.8.rc1 guides/code/getting_started/app/models/post.rb
railties-3.2.7 guides/code/getting_started/app/models/post.rb
railties-3.2.7.rc1 guides/code/getting_started/app/models/post.rb
challah-0.6.2 vendor/bundle/gems/railties-3.2.3/guides/code/getting_started/app/models/post.rb
challah-0.6.2 vendor/bundle/gems/railties-3.2.2/guides/code/getting_started/app/models/post.rb
challah-0.6.2 vendor/bundle/gems/railties-3.2.6/guides/code/getting_started/app/models/post.rb
challah-0.6.2 vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/models/post.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/guides/code/getting_started/app/models/post.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/guides/code/getting_started/app/models/post.rb
initforthe-cookies-0.0.1 vendor/bundle/gems/railties-3.2.6/guides/code/getting_started/app/models/post.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/guides/code/getting_started/app/models/post.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/guides/code/getting_started/app/models/post.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/guides/code/getting_started/app/models/post.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/guides/code/getting_started/app/models/post.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/guides/code/getting_started/app/models/post.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/guides/code/getting_started/app/models/post.rb
rails-uploader-0.0.4 vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/guides/code/getting_started/app/models/post.rb
rails-uploader-0.0.4 vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/guides/code/getting_started/app/models/post.rb
railties-3.2.6 guides/code/getting_started/app/models/post.rb