Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v4.5] Better Spree::UserAddress scope deprecation warnings #6165

Merged
merged 2 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/app/models/spree/user_address.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
end

scope :all_historical, -> {
Spree::Deprecation.warn("This scope does not do anything and will be removed from Solidus 5.")
Spree.deprecator.warn("The 'Spree::UserAddress.all_historical` scope does not do anything and will be removed from Solidus 5.")

Check warning on line 18 in core/app/models/spree/user_address.rb

View check run for this annotation

Codecov / codecov/patch

core/app/models/spree/user_address.rb#L18

Added line #L18 was not covered by tests
all
}
scope :default_shipping, -> { where(default: true) }
scope :default_billing, -> { where(default_billing: true) }
scope :active, -> {
Spree::Deprecation.warn("This scope does not do anything and will be removed from Solidus 5.")
Spree.deprecator.warn("The 'Spree::UserAddress.active` scope does not do anything and will be removed from Solidus 5.")

Check warning on line 24 in core/app/models/spree/user_address.rb

View check run for this annotation

Codecov / codecov/patch

core/app/models/spree/user_address.rb#L24

Added line #L24 was not covered by tests
all
}

Expand Down
6 changes: 1 addition & 5 deletions legacy_promotions/app/models/spree/promotion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,7 @@ def line_item_actionable?(order, line_item, promotion_code: nil)

if eligible?(order, promotion_code:)
rules = eligible_rules(order)
if rules.blank?
true
else
rules.all? { |rule| rule.actionable? line_item }
end
rules.blank? || rules.all? { |rule| rule.actionable? line_item }
else
false
end
Expand Down