diff options
author | George Claghorn <george@basecamp.com> | 2019-07-20 06:33:11 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-20 06:33:11 -0400 |
commit | 400b2103540e1dfb370eab29a891687d778ad357 (patch) | |
tree | f5b85f2bca64559e9b75edfd1e176db03ecaa7f8 /activestorage/lib/active_storage.rb | |
parent | 876548a7e7307fc7d4c22fb6560df1474353d0cf (diff) | |
download | rails-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 'activestorage/lib/active_storage.rb')
-rw-r--r-- | activestorage/lib/active_storage.rb | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/activestorage/lib/active_storage.rb b/activestorage/lib/active_storage.rb index 5c5da551ae..75eb63f0b4 100644 --- a/activestorage/lib/active_storage.rb +++ b/activestorage/lib/active_storage.rb @@ -43,18 +43,26 @@ module ActiveStorage mattr_accessor :logger mattr_accessor :verifier + mattr_accessor :variant_processor, default: :mini_magick + mattr_accessor :queues, default: {} + mattr_accessor :previewers, default: [] - mattr_accessor :analyzers, default: [] - mattr_accessor :variant_processor, default: :mini_magick + mattr_accessor :analyzers, default: [] + mattr_accessor :paths, default: {} - mattr_accessor :variable_content_types, default: [] + + mattr_accessor :variable_content_types, default: [] + mattr_accessor :binary_content_type, default: "application/octet-stream" mattr_accessor :content_types_to_serve_as_binary, default: [] - mattr_accessor :content_types_allowed_inline, default: [] - mattr_accessor :binary_content_type, default: "application/octet-stream" + mattr_accessor :content_types_allowed_inline, default: [] + mattr_accessor :service_urls_expire_in, default: 5.minutes + mattr_accessor :routes_prefix, default: "/rails/active_storage" + mattr_accessor :replace_on_assign_to_many, default: false + module Transformers extend ActiveSupport::Autoload |