aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2017-07-28 15:43:53 -0500
committerDavid Heinemeier Hansson <david@loudthinking.com>2017-07-28 15:43:53 -0500
commit1f150e0218918ae6a9f82dbb89621c16a5c7ddc2 (patch)
tree80a3717e844dedbdd1b7c1f899cccf172ca8f2c4
parent801b4eb465cd48435abddac881b92c93470b6933 (diff)
downloadrails-1f150e0218918ae6a9f82dbb89621c16a5c7ddc2.tar.gz
rails-1f150e0218918ae6a9f82dbb89621c16a5c7ddc2.tar.bz2
rails-1f150e0218918ae6a9f82dbb89621c16a5c7ddc2.zip
Must always return the options even if they werent converted
-rw-r--r--app/helpers/active_storage/file_field_with_direct_upload_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/helpers/active_storage/file_field_with_direct_upload_helper.rb b/app/helpers/active_storage/file_field_with_direct_upload_helper.rb
index 87af79cdfd..7c5fd0eb55 100644
--- a/app/helpers/active_storage/file_field_with_direct_upload_helper.rb
+++ b/app/helpers/active_storage/file_field_with_direct_upload_helper.rb
@@ -12,7 +12,7 @@ module ActiveStorage
private
def convert_direct_upload_option_to_url(options)
- options.merge('data-direct-upload-url': rails_direct_uploads_url) if options.delete(:direct_upload)
+ options.merge('data-direct-upload-url': options.delete(:direct_upload) ? rails_direct_uploads_url : nil).compact
end
end
end