mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Merge pull request #13247 from cyrillefr/FixRailsRubocopIssueInverseOfInOrder
Fix Rubocop InverseOf offense in Order model
This commit is contained in:
@@ -474,13 +474,6 @@ RSpecRails/InferredSpecType:
|
||||
- 'spec/requests/voucher_adjustments_spec.rb'
|
||||
- 'spec/routing/stripe_spec.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Configuration parameters: IgnoreScopes, Include.
|
||||
# Include: app/models/**/*.rb
|
||||
Rails/InverseOf:
|
||||
Exclude:
|
||||
- 'app/models/spree/order.rb'
|
||||
|
||||
# Offense count: 35
|
||||
# Configuration parameters: Include.
|
||||
# Include: app/controllers/**/*.rb, app/mailers/**/*.rb
|
||||
|
||||
@@ -43,7 +43,7 @@ module Spree
|
||||
has_many :state_changes, as: :stateful, dependent: :destroy
|
||||
has_many :line_items, -> {
|
||||
order('created_at ASC')
|
||||
}, class_name: "Spree::LineItem", dependent: :destroy
|
||||
}, class_name: "Spree::LineItem", inverse_of: :order, dependent: :destroy
|
||||
has_many :payments, dependent: :destroy
|
||||
has_many :return_authorizations, dependent: :destroy, inverse_of: :order
|
||||
has_many :adjustments, -> { order "#{Spree::Adjustment.table_name}.created_at ASC" },
|
||||
|
||||
@@ -189,8 +189,8 @@ RSpec.describe Spree::OrderContents do
|
||||
|
||||
subject.update_item(line_item, { quantity: 3 })
|
||||
end
|
||||
|
||||
it "updates the order's enterprise fees if completed" do
|
||||
order.shipments << create(:shipment)
|
||||
allow(order).to receive(:completed?) { true }
|
||||
expect(order).to receive(:update_order_fees!)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user