From 4300f945330d885665c84f076182d9650a1a0867 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Thu, 7 Jan 2010 13:30:51 -0800 Subject: Revert "Remove connection method definition, since it's called just once." Restore the connection method which was added so it can be overridden. This reverts commit e428c75d2b67c6a7bd5f5e7e1719cdece84d497f. --- activerecord/lib/active_record/migration.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index 09a558a636..0022e8cc37 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -339,6 +339,10 @@ module ActiveRecord self.verbose = save end + def connection + ActiveRecord::Base.connection + end + def method_missing(method, *arguments, &block) arg_list = arguments.map(&:inspect) * ', ' @@ -346,7 +350,7 @@ module ActiveRecord unless arguments.empty? || method == :execute arguments[0] = Migrator.proper_table_name(arguments.first) end - Base.connection.send(method, *arguments, &block) + connection.send(method, *arguments, &block) end end end -- cgit v1.2.3