diff options
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/engine.rb | 6 | ||||
-rw-r--r-- | railties/lib/rails/paths.rb | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index c41f7d7c2e..2c3f61f404 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -542,9 +542,9 @@ 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) + app.config.assets.paths.unshift(*paths["vendor/assets"].existent_directories) + app.config.assets.paths.unshift(*paths["lib/assets"].existent_directories) + app.config.assets.paths.unshift(*paths["app/assets"].existent_directories) end initializer :prepend_helpers_path do |app| diff --git a/railties/lib/rails/paths.rb b/railties/lib/rails/paths.rb index de3d0b6fc5..55b820b12e 100644 --- a/railties/lib/rails/paths.rb +++ b/railties/lib/rails/paths.rb @@ -171,6 +171,10 @@ module Rails def existent expanded.select { |f| File.exists?(f) } end + + def existent_directories + expanded.select {|d| Dir.exists?(d) } + end alias to_a expanded end |