From 54823fe6b93d75a90cd627e3852669b5721fdd1f Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Thu, 19 May 2011 21:49:50 -0500 Subject: Use sprockets prepend_path if its available --- railties/lib/rails/engine.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index e26f73ed8d..81a0350724 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -522,9 +522,15 @@ module Rails end initializer :append_assets_path do |app| - app.config.assets.paths.unshift(*paths["vendor/assets"].existent) - app.config.assets.paths.unshift(*paths["lib/assets"].existent) - app.config.assets.paths.unshift(*paths["app/assets"].existent) + if app.config.assets.respond_to?(:prepend_path) + app.config.assets.prepend_path(*paths["vendor/assets"].existent) + app.config.assets.prepend_path(*paths["lib/assets"].existent) + app.config.assets.prepend_path(*paths["app/assets"].existent) + else + app.config.assets.paths.unshift(*paths["vendor/assets"].existent) + app.config.assets.paths.unshift(*paths["lib/assets"].existent) + app.config.assets.paths.unshift(*paths["app/assets"].existent) + end end initializer :prepend_helpers_path do |app| -- cgit v1.2.3