mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
bd33ddaf71
https://github.com/rails/rails/issues/41653 noted an issue where if there's service configured (`config.active_storage.service` is commented out), Blob creation via direct upload crashes: ``` Started POST "/rails/active_storage/direct_uploads" for ::1 at 2021-03-09 13:02:57 -0800 Processing by ActiveStorage::DirectUploadsController#create as JSON Parameters: {"blob"=>{"filename"=>"banana.jpg", "content_type"=>"image/jpeg", "byte_size"=>577085, "checksum"=>"W/vo/JqBNmJHMCaL+PRlBQ=="}, "direct_upload"=>{"blob"=>{"filename"=>"banana.jpg", "content_type"=>"image/jpeg", "byte_size"=>577085, "checksum"=>"W/vo/JqBNmJHMCaL+PRlBQ=="}}} Completed 500 Internal Server Error in 12ms (ActiveRecord: 3.3ms | Allocations: 5864) NoMethodError (undefined method `name' for nil:NilClass): activestorage (6.1.3) app/models/active_storage/blob.rb:52:in `block in <class:Blob>' activesupport (6.1.3) lib/active_support/callbacks.rb:427:in `instance_exec' ``` This PR fixes that crash. Blob creation will still fail, but with a more informative error about a `service_name` being required. |
||
---|---|---|
.. | ||
blob | ||
attachment.rb | ||
blob.rb | ||
current.rb | ||
filename.rb | ||
preview.rb | ||
record.rb | ||
variant.rb | ||
variant_record.rb | ||
variant_with_record.rb | ||
variation.rb |