aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--railties/CHANGELOG.md2
-rw-r--r--railties/lib/rails/paths.rb18
-rw-r--r--railties/test/application/paths_test.rb3
3 files changed, 6 insertions, 17 deletions
diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md
index 2aeab9bdf0..d73af824d6 100644
--- a/railties/CHANGELOG.md
+++ b/railties/CHANGELOG.md
@@ -38,8 +38,6 @@
* Ensure that `RAILS_ENV` is set when accessing Rails.env *Steve Klabnik*
-* Don't eager-load `app/assets` and `app/views` *Elia Schito*
-
* Add `.rake` to list of file extensions included by `rake notes` and `rake notes:custom`. *Brent J. Nordquist*
* New test locations `test/models`, `test/helpers`, `test/controllers`, and
diff --git a/railties/lib/rails/paths.rb b/railties/lib/rails/paths.rb
index cfdb15a14e..8af4130e87 100644
--- a/railties/lib/rails/paths.rb
+++ b/railties/lib/rails/paths.rb
@@ -99,15 +99,14 @@ module Rails
protected
def filter_by(constraint)
- yes = []
- no = []
-
+ all = []
all_paths.each do |path|
- paths = path.existent + path.existent_base_paths
- path.send(constraint) ? yes.concat(paths) : no.concat(paths)
+ if path.send(constraint)
+ paths = path.existent
+ paths -= path.children.map { |p| p.send(constraint) ? [] : p.existent }.flatten
+ all.concat(paths)
+ end
end
-
- all = yes - no
all.uniq!
all
end
@@ -135,7 +134,6 @@ module Rails
keys.delete(@current)
@root.values_at(*keys.sort)
end
- deprecate :children
def first
expanded.first
@@ -212,10 +210,6 @@ module Rails
expanded.select { |d| File.directory?(d) }
end
- def existent_base_paths
- map { |p| File.expand_path(p, @root.path) }.select{ |f| File.exist? f }
- end
-
alias to_a expanded
end
end
diff --git a/railties/test/application/paths_test.rb b/railties/test/application/paths_test.rb
index 2265d220ab..f462ba1e05 100644
--- a/railties/test/application/paths_test.rb
+++ b/railties/test/application/paths_test.rb
@@ -59,8 +59,6 @@ module ApplicationTests
assert eager_load.include?(root("app/controllers"))
assert eager_load.include?(root("app/helpers"))
assert eager_load.include?(root("app/models"))
- assert !eager_load.include?(root("app/views")), "expected to not be in the eager_load_path"
- assert !eager_load.include?(root("app/assets")), "expected to not be in the eager_load_path"
end
test "environments has a glob equal to the current environment" do
@@ -75,7 +73,6 @@ module ApplicationTests
assert_in_load_path "vendor"
assert_not_in_load_path "app", "views"
- assert_not_in_load_path "app", "assets"
assert_not_in_load_path "config"
assert_not_in_load_path "config", "locales"
assert_not_in_load_path "config", "environments"