aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2018-01-07 09:02:22 -0500
committerGeorge Claghorn <george@basecamp.com>2018-01-07 09:02:22 -0500
commit1223782598ecfe7bcd68de094bf447724b9d92c0 (patch)
tree36ec49ef8dfb9fa48cf3ed7dd660a4d0fdceccdb /activestorage
parentf5328d9379da473bfc5420996693a14c6e0d2556 (diff)
downloadrails-1223782598ecfe7bcd68de094bf447724b9d92c0.tar.gz
rails-1223782598ecfe7bcd68de094bf447724b9d92c0.tar.bz2
rails-1223782598ecfe7bcd68de094bf447724b9d92c0.zip
Tweak engine for readability
Diffstat (limited to 'activestorage')
-rw-r--r--activestorage/lib/active_storage/engine.rb24
1 files changed, 13 insertions, 11 deletions
diff --git a/activestorage/lib/active_storage/engine.rb b/activestorage/lib/active_storage/engine.rb
index 1f15ac2d2d..8ba32490b1 100644
--- a/activestorage/lib/active_storage/engine.rb
+++ b/activestorage/lib/active_storage/engine.rb
@@ -17,17 +17,18 @@ module ActiveStorage
config.active_storage.previewers = [ ActiveStorage::Previewer::PDFPreviewer, ActiveStorage::Previewer::VideoPreviewer ]
config.active_storage.analyzers = [ ActiveStorage::Analyzer::ImageAnalyzer, ActiveStorage::Analyzer::VideoAnalyzer ]
config.active_storage.paths = ActiveSupport::OrderedOptions.new
- config.active_storage.variable_content_types = [ "image/png", "image/gif", "image/jpg", "image/jpeg", "image/vnd.adobe.photoshop" ]
- config.active_storage.content_types_to_serve_as_binary = [
- "text/html",
- "text/javascript",
- "image/svg+xml",
- "application/postscript",
- "application/x-shockwave-flash",
- "text/xml",
- "application/xml",
- "application/xhtml+xml"
- ]
+
+ config.active_storage.variable_content_types = %w( image/png image/gif image/jpg image/jpeg image/vnd.adobe.photoshop )
+ config.active_storage.content_types_to_serve_as_binary = %w(
+ text/html
+ text/javascript
+ image/svg+xml
+ application/postscript
+ application/x-shockwave-flash
+ text/xml
+ application/xml
+ application/xhtml+xml
+ )
config.eager_load_namespaces << ActiveStorage
@@ -38,6 +39,7 @@ module ActiveStorage
ActiveStorage.previewers = app.config.active_storage.previewers || []
ActiveStorage.analyzers = app.config.active_storage.analyzers || []
ActiveStorage.paths = app.config.active_storage.paths || {}
+
ActiveStorage.variable_content_types = app.config.active_storage.variable_content_types || []
ActiveStorage.content_types_to_serve_as_binary = app.config.active_storage.content_types_to_serve_as_binary || []
end