aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-12-18 16:05:30 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-12-18 16:05:30 -0300
commit7f96e4317e1354852e9600becb16662de3c17691 (patch)
tree67da6d24347e0d46aab3b425ed44c6060e93854e /railties/lib/rails
parente4003adff93a1379a5e632f7e199c61bf34c293d (diff)
downloadrails-7f96e4317e1354852e9600becb16662de3c17691.tar.gz
rails-7f96e4317e1354852e9600becb16662de3c17691.tar.bz2
rails-7f96e4317e1354852e9600becb16662de3c17691.zip
Revert "Merge pull request #7587 from elia/fix-too-eager-loading"
This reverts commit 3663057518eb9acf9b1e72f47dcb07038e6b7368. REASON: This caused a regression that add app folder in the eager load path. See #8146 for more information. Conflicts: railties/CHANGELOG.md
Diffstat (limited to 'railties/lib/rails')
-rw-r--r--railties/lib/rails/paths.rb18
1 files changed, 6 insertions, 12 deletions
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