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:
Matt-Yorkley
2021-01-13 14:46:22 +00:00
parent a328a9bc1b
commit 173e502c98
2 changed files with 3 additions and 3 deletions

View File

@@ -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') }

View File

@@ -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