Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #5416 from kennyj/fix_5399

Fix GH #5399. connection_pools's keys are ActiveRecord::Base::ConnectionSpecification objects.
  • Loading branch information...
commit dbdbe961cd41a5fa69d6e0e92943195e2fb4d279 2 parents 21b69b2 + fdb8805
@tenderlove tenderlove authored
View
2  activerecord/lib/active_record/core.rb
@@ -130,7 +130,7 @@ def arel_table
end
def arel_engine
- @arel_engine ||= connection_handler.connection_pools[name] ? self : active_record_super.arel_engine
+ @arel_engine ||= connection_handler.retrieve_connection_pool(self) ? self : active_record_super.arel_engine
end
private
View
8 activerecord/test/cases/multiple_db_test.rb
@@ -86,7 +86,13 @@ 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
unless in_memory_db?
Please sign in to comment.
Something went wrong with that request. Please try again.