From cd0d5902dd237794049cac1ee89ab0c07a16a851 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Wed, 10 Jul 2013 17:14:33 +0900 Subject: Speedup AS::Inflector.deconstantize Benchmark: user system total real old 0.740000 0.000000 0.740000 ( 0.744358) new 0.550000 0.000000 0.550000 ( 0.553690) --- activesupport/lib/active_support/inflector/methods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/inflector/methods.rb b/activesupport/lib/active_support/inflector/methods.rb index 9ca5a388f8..18c94a4997 100644 --- a/activesupport/lib/active_support/inflector/methods.rb +++ b/activesupport/lib/active_support/inflector/methods.rb @@ -184,7 +184,7 @@ module ActiveSupport # # See also +demodulize+. def deconstantize(path) - path.to_s[0...(path.rindex('::') || 0)] # implementation based on the one in facets' Module#spacename + path.to_s[0, path.rindex('::') || 0] # implementation based on the one in facets' Module#spacename end # Creates a foreign key name from a class name. -- cgit v1.2.3