Sha256: 6e7ac5b1e7dbd140963420a9764ae79a315d57cc868cd972d98af5d650c65f34

Contents?: true

Size: 574 Bytes

Versions: 42

Compression:

Stored size: 574 Bytes

Contents

Spree::Sample.load_sample('orders')

first_order = Spree::Order.find_by!(number: 'R123456789')
last_order = Spree::Order.find_by!(number: 'R987654321')

first_order.adjustments.where(
  source: Spree::TaxRate.find_by!(name: 'North America'),
  order: first_order,
  label: 'Tax',
  state: 'open',
  mandatory: true
).first_or_create! do |adj|
  adj.amount = 0
end

last_order.adjustments.where(
  source: Spree::TaxRate.find_by!(name: 'North America'),
  order: last_order,
  label: 'Tax',
  state: 'open',
  mandatory: true
).first_or_create! do |adj|
  adj.amount = 0
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
spree_sample-4.0.9 db/samples/adjustments.rb
spree_sample-4.0.8 db/samples/adjustments.rb
spree_sample-3.7.14.1 db/samples/adjustments.rb
spree_sample-4.0.7.1 db/samples/adjustments.rb
spree_sample-4.0.7 db/samples/adjustments.rb
spree_sample-3.7.14 db/samples/adjustments.rb
spree_sample-4.0.6 db/samples/adjustments.rb
spree_sample-3.7.13 db/samples/adjustments.rb
spree_sample-4.0.5 db/samples/adjustments.rb
spree_sample-3.7.12 db/samples/adjustments.rb
spree_sample-4.0.4 db/samples/adjustments.rb
spree_sample-3.7.11 db/samples/adjustments.rb
spree_sample-3.7.10 db/samples/adjustments.rb
spree_sample-4.0.3 db/samples/adjustments.rb
spree_sample-3.7.9 db/samples/adjustments.rb
spree_sample-4.0.2 db/samples/adjustments.rb
spree_sample-3.7.8 db/samples/adjustments.rb
spree_sample-4.0.1 db/samples/adjustments.rb
spree_sample-3.7.7 db/samples/adjustments.rb
spree_sample-4.0.0 db/samples/adjustments.rb