Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/app/models/spree/order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class CannotRebuildShipments < StandardError; end
belongs_to :store, class_name: 'Spree::Store'
has_many :state_changes, as: :stateful
has_many :line_items, -> { order(:created_at, :id) }, dependent: :destroy, inverse_of: :order
has_many :payments, dependent: :destroy
has_many :payments, dependent: :destroy, inverse_of: :order
has_many :return_authorizations, dependent: :destroy, inverse_of: :order
has_many :reimbursements, inverse_of: :order
has_many :adjustments, -> { order(:created_at) }, as: :adjustable, inverse_of: :adjustable, dependent: :destroy
Expand Down
4 changes: 0 additions & 4 deletions core/spec/models/spree/order/payment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ module Spree

context "ensure source attributes stick around" do
# For the reason of this test, please see spree/spree_gateway#132
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe delete the comment as well? lol

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think we should, the test that is in this context is the regression for the issue mentioned in the comment.

it "does not have inverse_of defined" do
expect(Spree::Order.reflections['payments'].options[:inverse_of]).to be_nil
end

it "keeps source attributes after updating" do
persisted_order = Spree::Order.create
credit_card_payment_method = create(:credit_card_payment_method)
Expand Down