Skip to content
This repository

[3-2-stable] Fix GH #5399. connection_pools's keys are ActiveRecord::Base::ConnectionSpecification objects. #5417

Merged
merged 1 commit into from about 2 years ago

2 participants

Toshinori Kajihara Aaron Patterson
Toshinori Kajihara
Collaborator

Please see #5416 .

Closes #5399

Toshinori Kajihara
Collaborator
Aaron Patterson tenderlove merged commit 596ecf7 into from March 13, 2012
Aaron Patterson tenderlove closed this March 13, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Mar 14, 2012
Toshinori Kajihara [3-2-stable] Fix GH #5399. connection_pools's keys are ActiveRecord::…
…Base::ConnectionSpecification objects.
21d9c0f
This page is out of date. Refresh to see the latest.
2  activerecord/lib/active_record/base.rb
@@ -442,7 +442,7 @@ def arel_engine
442 442
           if self == ActiveRecord::Base
443 443
             ActiveRecord::Base
444 444
           else
445  
-            connection_handler.connection_pools[name] ? self : superclass.arel_engine
  445
+            connection_handler.retrieve_connection_pool(self) ? self : superclass.arel_engine
446 446
           end
447 447
         end
448 448
       end
8  activerecord/test/cases/multiple_db_test.rb
@@ -85,6 +85,12 @@ def test_transactions_across_databases
85 85
   end
86 86
 
87 87
   def test_arel_table_engines
88  
-    assert_equal Entrant.arel_engine, Bird.arel_engine
  88
+    assert_not_equal Entrant.arel_engine, Bird.arel_engine
  89
+    assert_not_equal Entrant.arel_engine, Course.arel_engine
  90
+  end
  91
+
  92
+  def test_connection
  93
+    assert_equal Entrant.arel_engine.connection, Bird.arel_engine.connection
  94
+    assert_not_equal Entrant.arel_engine.connection, Course.arel_engine.connection
89 95
   end
90 96
 end
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.