Sha256: 1acab710d2218ff300eece4ffae222c80c518edf79973510ff9d5f9586e30b58

Contents?: true

Size: 554 Bytes

Versions: 67

Compression:

Stored size: 554 Bytes

Contents

Spree::Sample.load_sample('orders')

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

tax_rate = Spree::TaxRate.find_by!(name: 'California')

first_order.adjustments.where(
  source: tax_rate,
  order: first_order,
  label: 'Tax',
  state: 'open',
  mandatory: true
).first_or_create! do |adj|
  adj.amount = 0
end

last_order.adjustments.where(
  source: tax_rate,
  order: last_order,
  label: 'Tax',
  state: 'open',
  mandatory: true
).first_or_create! do |adj|
  adj.amount = 0
end

Version data entries

67 entries across 67 versions & 1 rubygems

Version Path
spree_sample-4.10.1 db/samples/adjustments.rb
spree_sample-4.10.0 db/samples/adjustments.rb
spree_sample-4.9.0 db/samples/adjustments.rb
spree_sample-4.8.3 db/samples/adjustments.rb
spree_sample-4.8.2 db/samples/adjustments.rb
spree_sample-4.7.3 db/samples/adjustments.rb
spree_sample-4.6.6 db/samples/adjustments.rb
spree_sample-4.5.5 db/samples/adjustments.rb
spree_sample-4.1.15 db/samples/adjustments.rb
spree_sample-4.2.7 db/samples/adjustments.rb
spree_sample-4.3.3 db/samples/adjustments.rb
spree_sample-4.4.1 db/samples/adjustments.rb
spree_sample-4.5.4 db/samples/adjustments.rb
spree_sample-4.6.5 db/samples/adjustments.rb
spree_sample-4.7.1 db/samples/adjustments.rb
spree_sample-4.6.4 db/samples/adjustments.rb
spree_sample-4.7.0 db/samples/adjustments.rb
spree_sample-4.6.3 db/samples/adjustments.rb
spree_sample-4.6.2 db/samples/adjustments.rb
spree_sample-4.6.1 db/samples/adjustments.rb