From 82f18eabf3cf5d035508fb23c3f7072f9c7d9a41 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Tue, 12 Sep 2017 02:49:32 +0800 Subject: Reset all connection schema cache after migration tests We might also want to consider reduce the number of connections in the tests. However I just tried setting it to 1 and that doesn't seem enough for feature tests. --- spec/support/migrations_helpers.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/support/migrations_helpers.rb b/spec/support/migrations_helpers.rb index 4ca019c1b05..6522d74ba89 100644 --- a/spec/support/migrations_helpers.rb +++ b/spec/support/migrations_helpers.rb @@ -16,7 +16,9 @@ module MigrationsHelpers end def reset_column_in_migration_models - ActiveRecord::Base.clear_cache! + ActiveRecord::Base.connection_pool.connections.each do |conn| + conn.schema_cache.clear! + end described_class.constants.sort.each do |name| const = described_class.const_get(name) -- cgit v1.2.1