aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorDiego Carrion <dc.rec1@gmail.com>2011-03-05 01:57:25 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2011-03-09 00:28:03 -0200
commitc7cfdd01c114e103508c435d5e6cfee0703e2e1d (patch)
tree81143ee1643637fab9325eeaf89e3da576700dc2 /railties/lib
parent0c777bace2aed1833e068358461de62bbd59cd0c (diff)
downloadrails-c7cfdd01c114e103508c435d5e6cfee0703e2e1d.tar.gz
rails-c7cfdd01c114e103508c435d5e6cfee0703e2e1d.tar.bz2
rails-c7cfdd01c114e103508c435d5e6cfee0703e2e1d.zip
refactored Engine.#find by giving an explicit name to a variable and reducing calls
[#6529 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails/engine.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb
index 50bba22a3a..4fc23fe277 100644
--- a/railties/lib/rails/engine.rb
+++ b/railties/lib/rails/engine.rb
@@ -382,9 +382,9 @@ module Rails
# Finds engine with given path
def find(path)
- path = path.to_s
- Rails::Engine::Railties.engines.find { |r|
- File.expand_path(r.root.to_s) == File.expand_path(path)
+ expanded_path = File.expand_path path.to_s
+ Rails::Engine::Railties.engines.find { |engine|
+ File.expand_path(engine.root.to_s) == expanded_path
}
end
end