Skip to content

Commit

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

Ref solidusio#4960
  • Loading branch information
kennyadsl committed Mar 17, 2023
1 parent e4d5102 commit b4cb65c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
6 changes: 0 additions & 6 deletions core/app/models/concerns/spree/default_price.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ def default_price_or_build
prices.build(self.class.default_price_attributes)
end

# @deprecated Use {#default_price_or_build} instead.
def find_or_build_default_price
default_price_or_build
end
deprecate find_or_build_default_price: :default_price_or_build, deprecator: Spree::Deprecation

# Select from {#prices} the one to be considered as the default
#
# This method works with the in-memory association, so non-persisted prices
Expand Down
19 changes: 0 additions & 19 deletions core/spec/models/spree/variant_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -334,25 +334,6 @@
end
end

describe '#find_or_build_default_price' do
it 'is deprecated' do
without_partial_double_verification do
expect(Spree::Deprecation).to receive(:warn)
end
variant.find_or_build_default_price
end

it 'is an alias for #default_price_or_build' do
without_partial_double_verification do
allow(Spree::Deprecation).to receive(:warn)
end

expect(variant).to receive(:default_price_or_build)

variant.find_or_build_default_price
end
end

describe '#has_default_price?' do
context 'when default price is present and not discarded' do
it 'returns true' do
Expand Down

0 comments on commit b4cb65c

Please sign in to comment.