diff options
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/migration.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index b132b3d820..0afb5c29e1 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -191,11 +191,11 @@ module ActiveRecord cattr_accessor :verbose class << self - def up_using_benchmarks #:nodoc: + def up_with_benchmarks #:nodoc: migrate(:up) end - def down_using_benchmarks #:nodoc: + def down_with_benchmarks #:nodoc: migrate(:down) end @@ -209,7 +209,7 @@ module ActiveRecord end result = nil - time = Benchmark.measure { result = send("real_#{direction}") } + time = Benchmark.measure { result = send("#{direction}_without_benchmarks") } case direction when :up then announce "migrated (%.4fs)" % time.real; write @@ -231,8 +231,7 @@ module ActiveRecord case sym when :up, :down klass = (class << self; self; end) - klass.send(:alias_method, "real_#{sym}", sym) - klass.send(:alias_method, sym, "#{sym}_using_benchmarks") + klass.send(:alias_method_chain, sym, "benchmarks") end ensure @ignore_new_methods = false |