From 7842caed942d5a410dcc0c22f2d3dfd808fa0cfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20L=C3=BCtke?= Date: Wed, 21 Feb 2007 21:54:41 +0000 Subject: Fixed query cache when multiple database connections were involved git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6195 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/query_cache_test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'activerecord/test') diff --git a/activerecord/test/query_cache_test.rb b/activerecord/test/query_cache_test.rb index 1ede03e70e..4cadc32316 100644 --- a/activerecord/test/query_cache_test.rb +++ b/activerecord/test/query_cache_test.rb @@ -2,6 +2,7 @@ require 'abstract_unit' require 'fixtures/topic' require 'fixtures/reply' require 'fixtures/task' +require 'fixtures/course' class QueryCacheTest < Test::Unit::TestCase fixtures :tasks @@ -43,6 +44,16 @@ class QueryCacheTest < Test::Unit::TestCase end end + def test_cache_does_not_blow_up_other_connections + assert_not_equal Course.connection.object_id, Task.connection.object_id, + "Connections should be different, Course connects to a different database" + + ActiveRecord::Base.cache do + assert_not_equal Course.connection.object_id, Task.connection.object_id, + "Connections should be different, Course connects to a different database" + end + end + end -- cgit v1.2.3