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.
This commit is contained in:
Javi Martín
2021-09-18 02:55:27 +02:00
parent 3302f8c64d
commit 390a82ff8e

View File

@@ -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.
#