Permalink
Browse files

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>
  • Loading branch information...
dcrec1 authored and spastorino committed Mar 5, 2011
1 parent 0c777ba commit c7cfdd01c114e103508c435d5e6cfee0703e2e1d
Showing with 3 additions and 3 deletions.
  1. +3 −3 railties/lib/rails/engine.rb
@@ -382,9 +382,9 @@ def isolate_namespace(mod)
# 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

0 comments on commit c7cfdd0

Please sign in to comment.