Permalink
Browse files

Migrations: make default database connection overridable

  • Loading branch information...
1 parent 922c528 commit 6f8ed1cd3fa595a59d7a19d8d383836b456ac803 @jeremy jeremy committed Feb 4, 2009
Showing with 5 additions and 1 deletion.
  1. +5 −1 activerecord/lib/active_record/migration.rb
@@ -338,14 +338,18 @@ def suppress_messages
self.verbose = save
end
+ def connection
+ ActiveRecord::Base.connection
+ end
+
def method_missing(method, *arguments, &block)
arg_list = arguments.map(&:inspect) * ', '
say_with_time "#{method}(#{arg_list})" do
unless arguments.empty? || method == :execute
arguments[0] = Migrator.proper_table_name(arguments.first)
end
- ActiveRecord::Base.connection.send(method, *arguments, &block)
+ connection.send(method, *arguments, &block)
end
end
end

0 comments on commit 6f8ed1c

Please sign in to comment.