aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-05-04 08:55:10 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2015-05-04 08:55:10 -0700
commitfcc46833a88cb287e92dbfec76091a0fa29d3948 (patch)
tree432448cc2c29fbb7ac9cdda5d8bf6ed188a69d1f /activerecord/test
parent9619331001828a9877b7a1e1a451f7ab98ca0285 (diff)
parent33fe7cc8892e7e2cf82f7cb0baf467590eb61988 (diff)
downloadrails-fcc46833a88cb287e92dbfec76091a0fa29d3948.tar.gz
rails-fcc46833a88cb287e92dbfec76091a0fa29d3948.tar.bz2
rails-fcc46833a88cb287e92dbfec76091a0fa29d3948.zip
Merge pull request #17632 from eugeneius/schema_cache_dump_connection_pool
Apply schema cache dump when creating connections
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/connection_pool_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/activerecord/test/cases/connection_pool_test.rb b/activerecord/test/cases/connection_pool_test.rb
index aa50efc979..f5928814a3 100644
--- a/activerecord/test/cases/connection_pool_test.rb
+++ b/activerecord/test/cases/connection_pool_test.rb
@@ -341,6 +341,21 @@ module ActiveRecord
handler.establish_connection anonymous, nil
}
end
+
+ def test_pool_sets_connection_schema_cache
+ connection = pool.checkout
+ schema_cache = SchemaCache.new connection
+ schema_cache.add(:posts)
+ pool.schema_cache = schema_cache
+
+ pool.with_connection do |conn|
+ assert_not_same pool.schema_cache, conn.schema_cache
+ assert_equal pool.schema_cache.size, conn.schema_cache.size
+ assert_same pool.schema_cache.columns(:posts), conn.schema_cache.columns(:posts)
+ end
+
+ pool.checkin connection
+ end
end
end
end