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
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
2 changes: 1 addition & 1 deletion core/app/models/spree/taxon.rb
Original file line number Diff line number Diff line change
@@ -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.

# Have taxonomy touch happen in #touch_ancestors_and_taxonomy rather than association option in order for imports to override.
taxonomy.try!(:touch)
end
5 changes: 2 additions & 3 deletions core/lib/spree/testing_support/dummy_app.rb
Original file line number Diff line number Diff line change
@@ -60,9 +60,8 @@ class Application < ::Rails::Application
config.active_support.deprecation = :stderr
config.secret_key_base = 'SECRET_TOKEN'

unless RAILS_6_OR_ABOVE
config.active_record.sqlite3.represent_boolean_as_integer = true
end
config.action_mailer.delivery_job = "ActionMailer::MailDeliveryJob" if RAILS_6_OR_ABOVE
config.active_record.sqlite3.represent_boolean_as_integer = true unless RAILS_6_OR_ABOVE

config.storage_path = Rails.root.join('tmp', 'storage')