Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #5417 from kennyj/fix_5399-32

[3-2-stable] Fix GH #5399. connection_pools's keys are ActiveRecord::Base::ConnectionSpecification objects.
  • Loading branch information...
commit 596ecf753eb87ee4f11fc87682b321c64b09d733 2 parents a782fea + 21d9c0f
@tenderlove tenderlove authored
View
2  activerecord/lib/active_record/base.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
View
8 activerecord/test/cases/multiple_db_test.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.