From 974ff0dd43826aa375417852356ceede1bd24cf2 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 17 Nov 2010 13:44:26 -0800 Subject: singleton method added is no longer needed --- activerecord/lib/active_record/migration.rb | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index 390c24c2f2..936e9a19a2 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -332,7 +332,7 @@ module ActiveRecord end result = nil - time = Benchmark.measure { result = send("#{direction}") } + time = Benchmark.measure { result = send(direction) } case direction when :up then announce "migrated (%.4fs)" % time.real; write @@ -342,24 +342,6 @@ module ActiveRecord result end - # Because the method added may do an alias_method, it can be invoked - # recursively. We use @ignore_new_methods as a guard to indicate whether - # it is safe for the call to proceed. - def singleton_method_added(sym) #:nodoc: - return if defined?(@ignore_new_methods) && @ignore_new_methods - - begin - @ignore_new_methods = true - - case sym - when :up, :down - singleton_class.send(:alias_method_chain, sym, "benchmarks") - end - ensure - @ignore_new_methods = false - end - end - def write(text="") puts(text) if verbose end -- cgit v1.2.3