diff options
Diffstat (limited to 'activerecord/test/support/postgresql_helper.rb')
-rw-r--r-- | activerecord/test/support/postgresql_helper.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/support/postgresql_helper.rb b/activerecord/test/support/postgresql_helper.rb new file mode 100644 index 0000000000..fa40a46499 --- /dev/null +++ b/activerecord/test/support/postgresql_helper.rb @@ -0,0 +1,8 @@ +module PostgresqlHelper + # Make sure to drop all cached query plans to prevent invalid reference errors like: + # cache lookup failed for type XYZ + def reset_pg_session + original_connection = ActiveRecord::Base.remove_connection + ActiveRecord::Base.establish_connection(original_connection) + end +end |