aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/configuring.md
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2019-07-20 06:33:11 -0400
committerGitHub <noreply@github.com>2019-07-20 06:33:11 -0400
commit400b2103540e1dfb370eab29a891687d778ad357 (patch)
treef5b85f2bca64559e9b75edfd1e176db03ecaa7f8 /guides/source/configuring.md
parent876548a7e7307fc7d4c22fb6560df1474353d0cf (diff)
downloadrails-400b2103540e1dfb370eab29a891687d778ad357.tar.gz
rails-400b2103540e1dfb370eab29a891687d778ad357.tar.bz2
rails-400b2103540e1dfb370eab29a891687d778ad357.zip
Preserve existing attachment assignment behavior for upgraded apps
Assigning to a collection of attachments appends rather than replacing, as in 5.2. Existing 5.2 apps that rely on this behavior will no longer break when they're upgraded to 6.0. For apps generated on 6.0 or newer, assigning replaces the existing attachments in the collection. #attach should be used to add new attachments to the collection without removing existing ones. I expect that we'll deprecate the old behavior in 6.1. Closes #36374.
Diffstat (limited to 'guides/source/configuring.md')
-rw-r--r--guides/source/configuring.md5
1 files changed, 4 insertions, 1 deletions
diff --git a/guides/source/configuring.md b/guides/source/configuring.md
index e53e8b4e92..4e0224b61e 100644
--- a/guides/source/configuring.md
+++ b/guides/source/configuring.md
@@ -881,7 +881,9 @@ text/javascript image/svg+xml application/postscript application/x-shockwave-fla
config.active_storage.routes_prefix = '/files'
```
- The default is `/rails/active_storage`
+ The default is `/rails/active_storage`.
+
+* `config.active_storage.replace_on_assign_to_many` determines whether assigning to a collection of attachments declared with `has_many_attached` replaces any existing attachments or appends to them. The default is `true`.
### Results of `load_defaults`
@@ -917,6 +919,7 @@ text/javascript image/svg+xml application/postscript application/x-shockwave-fla
- `config.active_job.return_false_on_aborted_enqueue`: `true`
- `config.active_storage.queues.analysis`: `:active_storage_analysis`
- `config.active_storage.queues.purge`: `:active_storage_purge`
+- `config.active_storage.replace_on_assign_to_many`: `true`
- `config.active_record.collection_cache_versioning`: `true`
### Configuring a Database