aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2015-01-07 15:59:15 -0700
committerSean Griffin <sean@seantheprogrammer.com>2015-01-07 15:59:15 -0700
commitaf2e0fec0971e1a9d76a5cd87c9324c3d92e5ec1 (patch)
tree3feab31df0649507c8c75ce11fc71bdb1fc1071b /activerecord/test
parent9892d445bcff57f0a8bd8eb467cb7bf8c40a285b (diff)
parent824862807be47bee5adbd15e365a2add57df5301 (diff)
downloadrails-af2e0fec0971e1a9d76a5cd87c9324c3d92e5ec1.tar.gz
rails-af2e0fec0971e1a9d76a5cd87c9324c3d92e5ec1.tar.bz2
rails-af2e0fec0971e1a9d76a5cd87c9324c3d92e5ec1.zip
Merge pull request #18377 from brainopia/custom_connection_with_count
Fix count on a separate connection
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/multiple_db_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/multiple_db_test.rb b/activerecord/test/cases/multiple_db_test.rb
index 3831de6ae3..15c60d5562 100644
--- a/activerecord/test/cases/multiple_db_test.rb
+++ b/activerecord/test/cases/multiple_db_test.rb
@@ -93,6 +93,13 @@ class MultipleDbTest < ActiveRecord::TestCase
assert_not_equal Entrant.arel_engine.connection, Course.arel_engine.connection
end
+ def test_count_on_custom_connection
+ ActiveRecord::Base.remove_connection
+ assert_equal 1, College.count
+ ensure
+ ActiveRecord::Base.establish_connection :arunit
+ end
+
unless in_memory_db?
def test_associations_should_work_when_model_has_no_connection
begin