Permalink
Browse files

Use sprockets prepend_path if its available

  • Loading branch information...
1 parent 0afd585 commit 54823fe6b93d75a90cd627e3852669b5721fdd1f @josh josh committed May 20, 2011
Showing with 9 additions and 3 deletions.
  1. +9 −3 railties/lib/rails/engine.rb
View
12 railties/lib/rails/engine.rb
@@ -522,9 +522,15 @@ def load_seed
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|

2 comments on commit 54823fe

@raggi
def append_end_form_to_template_outputs_like_a_boss
@josh
Ruby on Rails member

It was an api change to kill a bunch of array proxy wrapper crap:

sstephenson/sprockets@0a16e6d#L0L52

Please sign in to comment.