Sha256: 1dad560f7b23af17f9feaf472b77124bcaa206eeee7320038dafef70a8eb3f3e

Contents?: true

Size: 453 Bytes

Versions: 29

Compression:

Stored size: 453 Bytes

Contents

Factory.define(:variant) do |f|
  f.price 19.99
  f.cost_price 17.00
  f.sku    { Faker::Lorem.sentence }
  f.weight { BigDecimal.new("#{rand(200)}.#{rand(99)}") }
  f.height { BigDecimal.new("#{rand(200)}.#{rand(99)}") }
  f.width  { BigDecimal.new("#{rand(200)}.#{rand(99)}") }
  f.depth  { BigDecimal.new("#{rand(200)}.#{rand(99)}") }

  # associations:
  f.product { |p| p.association(:product) }
  f.option_values { [Factory(:option_value)] }
end

Version data entries

29 entries across 29 versions & 6 rubygems

Version Path
spree_core-0.70.7 lib/spree_core/testing_support/factories/variant_factory.rb
spree_core-0.70.6 lib/spree_core/testing_support/factories/variant_factory.rb
apispree_core-0.0.0 lib/spree_core/testing_support/factories/variant_factory.rb
My-Commerce_core-1.1.0 lib/spree_core/testing_support/factories/variant_factory.rb
My-Commerce_core-1.0.0 lib/spree_core/testing_support/factories/variant_factory.rb
MyCommerceapi-1.0.0 core/lib/spree_core/testing_support/factories/variant_factory.rb
MyCommerce-0.0.3 core/lib/spree_core/testing_support/factories/variant_factory.rb
rfcommerce_core-0.0.3 lib/spree_core/testing_support/factories/variant_factory.rb
spree_core-0.60.6 lib/spree_core/testing_support/factories/variant_factory.rb
spree_core-0.70.5 lib/spree_core/testing_support/factories/variant_factory.rb
spree_core-0.70.4 lib/spree_core/testing_support/factories/variant_factory.rb
spree_core-0.60.5 lib/spree_core/testing_support/factories/variant_factory.rb
spree_core-0.70.3 lib/spree_core/testing_support/factories/variant_factory.rb
spree_core-0.70.2 lib/spree_core/testing_support/factories/variant_factory.rb
spree_core-0.50.4 lib/spree_core/testing_support/factories/variant_factory.rb
spree_core-0.60.4 lib/spree_core/testing_support/factories/variant_factory.rb
spree_core-0.50.3 lib/spree_core/testing_support/factories/variant_factory.rb
spree_core-0.60.3 lib/spree_core/testing_support/factories/variant_factory.rb
spree_core-0.70.1 lib/spree_core/testing_support/factories/variant_factory.rb
spree_core-0.70.0 lib/spree_core/testing_support/factories/variant_factory.rb