Skip to content

Commit

Permalink
Remove deprecated Spree::DefaultPrice#currently_valid_prices
Browse files Browse the repository at this point in the history
Please, use Spree::Variant#default_price instead.

Ref solidusio#4639.
  • Loading branch information
kennyadsl committed Mar 17, 2023
1 parent ab59d64 commit e4d5102
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
9 changes: 0 additions & 9 deletions core/app/models/concerns/spree/default_price.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@ def self.default_price_attributes
end
end

# Returns `#prices` prioritized for being considered as default price
#
# @deprecated
# @return [ActiveRecord::Relation<Spree::Price>]
def currently_valid_prices
prices.currently_valid
end
deprecate :currently_valid_prices, deprecator: Spree::Deprecation

# Returns {#default_price} or builds it from {Spree::Variant.default_price_attributes}
#
# @return [Spree::Price, nil]
Expand Down
20 changes: 0 additions & 20 deletions core/spec/models/spree/variant_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -373,26 +373,6 @@
end
end

describe '#currently_valid_prices' do
around do |example|
Spree::Deprecation.silence do
example.run
end
end

it 'returns prioritized prices' do
price_1 = create(:price, country: create(:country))
price_2 = create(:price, country: nil)
variant = create(:variant, prices: [price_1, price_2])

result = variant.currently_valid_prices

expect(
result.index(price_1) < result.index(price_2)
).to be(true)
end
end

context "#cost_currency" do
context "when cost currency is nil" do
before { variant.cost_currency = nil }
Expand Down

0 comments on commit e4d5102

Please sign in to comment.