Permalink
Browse files

[3-2-stable] Fix GH #5399. connection_pools's keys are ActiveRecord::…

…Base::ConnectionSpecification objects.
  • Loading branch information...
kennyj committed Mar 13, 2012
1 parent dfbbf31 commit 21d9c0fc7f79f486fb2c67b3593e9496a1c57663
Showing with 8 additions and 2 deletions.
  1. +1 −1 activerecord/lib/active_record/base.rb
  2. +7 −1 activerecord/test/cases/multiple_db_test.rb
@@ -442,7 +442,7 @@ def arel_engine
if self == ActiveRecord::Base
ActiveRecord::Base
else
- connection_handler.connection_pools[name] ? self : superclass.arel_engine
+ connection_handler.retrieve_connection_pool(self) ? self : superclass.arel_engine
end
end
end
@@ -85,6 +85,12 @@ def test_transactions_across_databases
end
def test_arel_table_engines
- assert_equal Entrant.arel_engine, Bird.arel_engine
+ assert_not_equal Entrant.arel_engine, Bird.arel_engine
+ assert_not_equal Entrant.arel_engine, Course.arel_engine
+ end
+
+ def test_connection
+ assert_equal Entrant.arel_engine.connection, Bird.arel_engine.connection
+ assert_not_equal Entrant.arel_engine.connection, Course.arel_engine.connection
end
end

0 comments on commit 21d9c0f

Please sign in to comment.