From 1db4969dc9cabed9db162e7194b9353d43c967d7 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 2 Mar 2011 15:17:29 -0800 Subject: only compute path.to_s once --- railties/lib/rails/engine.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'railties/lib') diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index 6e5e842370..7c26234750 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -382,7 +382,10 @@ module Rails # Finds engine with given path def find(path) - Rails::Engine::Railties.engines.find { |r| File.expand_path(r.root.to_s) == File.expand_path(path.to_s) } + path = path.to_s + Rails::Engine::Railties.engines.find { |r| + File.expand_path(r.root.to_s) == File.expand_path(path) + } end end -- cgit v1.2.3