aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2011-02-09 12:14:48 +0100
committerPiotr Sarnacki <drogus@gmail.com>2011-02-09 12:19:20 +0100
commite6369bc9e97d0f1e5583725cd9f684bbe4fca3e1 (patch)
tree29ac97098c3d1264eff8c89303cc86b6ba11b665 /railties
parentd729e5f97e116a52ccd60232b728308cd08a367f (diff)
downloadrails-e6369bc9e97d0f1e5583725cd9f684bbe4fca3e1.tar.gz
rails-e6369bc9e97d0f1e5583725cd9f684bbe4fca3e1.tar.bz2
rails-e6369bc9e97d0f1e5583725cd9f684bbe4fca3e1.zip
Application's assets should have higher priority than engine's ones
[#6388 state:resolved]
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/application.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index 149c63cd9e..9cb3a0f008 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -149,7 +149,10 @@ module Rails
require "action_dispatch/http/rack_cache" if rack_cache
middleware.use ::Rack::Cache, rack_cache if rack_cache
- middleware.use ::ActionDispatch::Static, config.static_asset_paths if config.serve_static_assets
+ if config.serve_static_assets
+ asset_paths = ActiveSupport::OrderedHash[config.static_asset_paths.to_a.reverse]
+ middleware.use ::ActionDispatch::Static, asset_paths
+ end
middleware.use ::Rack::Lock unless config.allow_concurrency
middleware.use ::Rack::Runtime
middleware.use ::Rails::Rack::Logger