-
Notifications
You must be signed in to change notification settings - Fork 21.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow postgresql enum_test to be run in random order.
Creating and dropping similar tables within the same connection causes postgresql to look up old values in the cache of tables which have already been dropped.
- Loading branch information
Showing
3 changed files
with
21 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |