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.
This commit is contained in:
Lin Jen-Shin 2017-09-12 02:49:32 +08:00
parent 73a913f2b5
commit 82f18eabf3

View file

@ -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)