mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Rename #included scope to #inclusive
This method name (#included) is reserved and used internally by ActiveRecord. After updating Ruby, this has changed from a silent warning to a fatal error.
This commit is contained in:
@@ -70,7 +70,7 @@ module Spree
|
||||
scope :charge, -> { where('amount >= 0') }
|
||||
scope :credit, -> { where('amount < 0') }
|
||||
scope :return_authorization, -> { where(source_type: "Spree::ReturnAuthorization") }
|
||||
scope :included, -> { where(included: true) }
|
||||
scope :inclusive, -> { where(included: true) }
|
||||
scope :additional, -> { where(included: false) }
|
||||
|
||||
scope :enterprise_fee, -> { where(originator_type: 'EnterpriseFee') }
|
||||
|
||||
@@ -461,7 +461,7 @@ module Spree
|
||||
it_behaves_like "a model using the LocalizedNumber module", [:amount]
|
||||
end
|
||||
|
||||
describe "included and additional scopes" do
|
||||
describe "inclusive and additional scopes" do
|
||||
let!(:zone) { create(:zone_with_member) }
|
||||
let(:order) { create(:order) }
|
||||
let(:included_in_price) { true }
|
||||
@@ -477,7 +477,7 @@ module Spree
|
||||
|
||||
context "when tax is included in price" do
|
||||
it "is returned by the #included scope" do
|
||||
expect(Spree::Adjustment.included).to eq [adjustment]
|
||||
expect(Spree::Adjustment.inclusive).to eq [adjustment]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user