From 6a9d123698322e6134698e018e91f3c6daa1c298 Mon Sep 17 00:00:00 2001 From: Ernesto Tagwerker Date: Tue, 14 Oct 2014 09:33:47 -0300 Subject: [PATCH] Added pull request #151 by @21croissants. --- README.markdown | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/README.markdown b/README.markdown index 7a2681c..1257161 100644 --- a/README.markdown +++ b/README.markdown @@ -359,15 +359,26 @@ DatabaseCleaner[:mongoid].strategy = :truncation ### STDERR is being flooded when using Postgres -If you are using Postgres and have foreign key constraints, the truncation strategy will cause a lot of extra noise to appear on STDERR (in the form of "NOTICE truncate cascades" messages). To silence these warnings set the following log level in your `postgresql.conf` file: +If you are using Postgres and have foreign key constraints, the truncation strategy will cause a lot of extra noise to appear on STDERR (in the form of "NOTICE truncate cascades" messages). + +To silence these warnings set the following log level in your `postgresql.conf` file: ```ruby client_min_messages = warning ``` +For ActiveRecord, you add the following parameter in your database.yml file: + +
+test:
+  adapter: postgresql
+  # ...
+  min_messages: WARNING  
+
+ ### Nothing happens in JRuby with Sequel using transactions -Due to an inconsistency in JRuby's implementation of Fibers, Sequel gives a different connection to `DatabaseCleaner.start` than is used for tests run between `.start` and `.clean`. This can be worked around by running your tests in a block like `DatabaseCleaner.cleaning { run_my_tests }` instead, which does not use Fibers. +Due to an inconsistency in JRuby's implementation of Fibers, Sequel gives a different connection to `DatabaseCleaner.start` than is used for tests run between `.start` and `.clean`. This can be worked around by running your tests in a block like `DatabaseCleaner.cleaning { run_my_tests }` instead, which does not use Fibers. ## Debugging