Skip to content

Commit

Permalink
Replace update_attributes with update [#3334](solidusio/solidus#3334)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpfergus1 committed May 25, 2021
1 parent 2b88ae4 commit af72f50
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/solidus_expedited_exchanges/unreturned_item_charger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ def add_exchange_variants_to_order
new_inventory_unit_attributes[:order_id] = new_order.id
end

i.update_attributes!(new_inventory_unit_attributes)
i.update!(new_inventory_unit_attributes)
end
end
end

def set_shipment_for_new_order
@shipment.update_attributes!(order_id: new_order.id)
@shipment.update!(order_id: new_order.id)
new_order.shipments.reset
end

Expand Down
4 changes: 2 additions & 2 deletions spec/order_extension_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

context "shipment created before order" do
before do
order.shipments.first.update_attributes!(created_at: order.created_at - 1.day)
order.shipments.first.update!(created_at: order.created_at - 1.day)
end

it { is_expected.to be true }
Expand All @@ -55,7 +55,7 @@
subject { described_class.unreturned_exchange }

it 'includes orders that have a shipment created prior to the order' do
order.shipments.first.update_attributes!(created_at: order.created_at - 1.day)
order.shipments.first.update!(created_at: order.created_at - 1.day)
expect(subject).to include order
end

Expand Down
4 changes: 2 additions & 2 deletions spec/unreturned_item_charger_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@

describe "#charge_for_items" do
before do
original_variant.update_attributes!(track_inventory: true)
original_variant.update!(track_inventory: true)
original_variant.stock_items.update_all(backorderable: false)
end

subject { unreturned_item_charger.charge_for_items }

context "new order is not an unreturned exchange" do
before do
allow_any_instance_of(Spree::Shipment).to receive(:update_attributes!)
allow_any_instance_of(Spree::Shipment).to receive(:update!)
end

it "raises an error" do
Expand Down

0 comments on commit af72f50

Please sign in to comment.