From 390a82ff8edbe743f8f231324a86f7c9439f03e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 18 Sep 2021 02:55:27 +0200 Subject: [PATCH] Use Rails 6 attachments defaults in Active Storage In Active Storage 5.2 there was an unexpected behavior: assigning a collection appended records to the existing collection, instead of replacing them as it's done in Active Record associations. It doesn't really affect us, though, since we don't use `has_many_attached` anywhere. --- config/initializers/new_framework_defaults_6_0.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/new_framework_defaults_6_0.rb b/config/initializers/new_framework_defaults_6_0.rb index 91e3f6efb..f8cfdd436 100644 --- a/config/initializers/new_framework_defaults_6_0.rb +++ b/config/initializers/new_framework_defaults_6_0.rb @@ -28,7 +28,7 @@ Rails.application.config.active_job.return_false_on_aborted_enqueue = true # When assigning to a collection of attachments declared via `has_many_attached`, replace existing # attachments instead of appending. Use #attach to add new attachments without replacing existing ones. -# Rails.application.config.active_storage.replace_on_assign_to_many = true +Rails.application.config.active_storage.replace_on_assign_to_many = true # Use ActionMailer::MailDeliveryJob for sending parameterized and normal mail. #