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

Fix rails 61 deprecations #3740

Merged
merged 2 commits into from
Aug 24, 2020
Merged

Fix rails 61 deprecations #3740

merged 2 commits into from
Aug 24, 2020

Conversation

marcrohloff
Copy link
Contributor

Description

Fixes two Rails 6.1 deprecation warnings:

  1. Use MailDeliveryJob instead of DeliveryJob
  2. Fix 'Class level methods will no longer inherit scoping from * in Rails 6.1.' warning

Note: The second warning still occurs in several tests but originates from the acts_as_list and awesome_nested_set gem

> DEPRECATION WARNING: Class level methods will no longer inherit scoping from `*` in Rails 6.1. To continue using the scoped relation, pass it into the block directly. To instead access the full set of models, as Rails 6.1 will, use `Spree::Taxon.default_scoped`.

Note: This only fixes the warning originating from Spree. There are still some but they originate in `acts_as_list` and `awesome_nested_set`
@@ -134,7 +134,7 @@ def permalink_part=(value)

def touch_ancestors_and_taxonomy
# Touches all ancestors at once to avoid recursive taxonomy touch, and reduce queries.
self.class.where(id: ancestors.pluck(:id)).update_all(updated_at: Time.current)
self.class.default_scoped.where(id: ancestors.pluck(:id)).update_all(updated_at: Time.current)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rails/SkipsModelValidations: Avoid using update_all because it skips validations.

@aldesantis aldesantis merged commit 430c621 into solidusio:master Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants