Sha256: ef9bc374e77b464e34d47ab533a78f7ed058e93794a9ebbd8d9d7ab45dd7d26b

Contents?: true

Size: 549 Bytes

Versions: 291

Compression:

Stored size: 549 Bytes

Contents

class Product < ActiveRecord::Base
  validates_presence_of :title

  validates_inclusion_of :price, :in => 0..99,    :unless => :tangible
  validates_format_of :size, :with => /^\d+\D+$/, :unless => :tangible

  validates_presence_of :price,                   :if => :tangible
  validates_inclusion_of :price,  :in => 1..9999, :if => :tangible
  validates_inclusion_of :weight, :in => 1..100,  :if => :tangible
  validates_format_of :size, :with => /.+x.+x.+/, :if => :tangible
  validates_length_of :size, :in => 5..20,        :if => :tangible
end

Version data entries

291 entries across 170 versions & 30 rubygems

Version Path
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/shoulda-2.11.3/test/rails3_root/app/models/product.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/shoulda-2.11.3/test/rails2_root/app/models/product.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/shoulda-2.11.3/test/rails3_root/app/models/product.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/shoulda-2.11.3/test/rails3_root/app/models/product.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/shoulda-2.11.3/test/rails3_root/app/models/product.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/shoulda-2.11.3/test/rails2_root/app/models/product.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/shoulda-2.11.3/test/rails2_root/app/models/product.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/shoulda-2.11.3/test/rails2_root/app/models/product.rb
Flamefork-shoulda-2.10.1 test/rails_root/app/models/product.rb
Flamefork-shoulda-2.10.2 test/rails_root/app/models/product.rb
auser-poolparty-1.3.0 vendor/gems/shoulda/test/rails_root/app/models/product.rb
auser-poolparty-1.3.1 vendor/gems/shoulda/test/rails_root/app/models/product.rb
auser-poolparty-1.3.10 vendor/gems/shoulda/test/rails_root/app/models/product.rb
auser-poolparty-1.3.11 vendor/gems/shoulda/test/rails_root/app/models/product.rb
auser-poolparty-1.3.12 vendor/gems/shoulda/test/rails_root/app/models/product.rb
auser-poolparty-1.3.13 vendor/gems/shoulda/test/rails_root/app/models/product.rb
auser-poolparty-1.3.14 vendor/gems/shoulda/test/rails_root/app/models/product.rb
auser-poolparty-1.3.15 vendor/gems/shoulda/test/rails_root/app/models/product.rb
auser-poolparty-1.3.16 vendor/gems/shoulda/test/rails_root/app/models/product.rb
auser-poolparty-1.3.17 vendor/gems/shoulda/test/rails_root/app/models/product.rb