aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-03-02 15:17:29 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-03-02 15:17:29 -0800
commit1db4969dc9cabed9db162e7194b9353d43c967d7 (patch)
tree4385d0c498ad79a20885cd2ab3f0854d12dc6871 /railties/lib
parentdc89e29f4937a68e91cd7572f45f06c523430c23 (diff)
downloadrails-1db4969dc9cabed9db162e7194b9353d43c967d7.tar.gz
rails-1db4969dc9cabed9db162e7194b9353d43c967d7.tar.bz2
rails-1db4969dc9cabed9db162e7194b9353d43c967d7.zip
only compute path.to_s once
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails/engine.rb5
1 files changed, 4 insertions, 1 deletions
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