From 03a943ea84a4d7ed2e57d6ad74c357ec1982a956 Mon Sep 17 00:00:00 2001 From: Thomas Walpole Date: Tue, 1 Dec 2015 15:13:06 -0800 Subject: [PATCH] Update README.md Remove the suggestion of sharing database connections between threads, it's error prone and definitely not a good idea for beginner users of Capybara --- README.md | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/README.md b/README.md index e60bad1c..30be22ec 100644 --- a/README.md +++ b/README.md @@ -684,23 +684,6 @@ Cucumber handles this by using truncation instead of transactions, i.e. they empty out the entire database after each test. You can get the same behaviour by using a gem such as [database_cleaner](https://github.com/DatabaseCleaner/database_cleaner). -It is also possible to force your ORM to use the same transaction for all -threads. This may have thread safety implications and could cause strange -failures, so use caution with this approach. It can be implemented in -ActiveRecord through the following monkey patch: - -```ruby -class ActiveRecord::Base - mattr_accessor :shared_connection - @@shared_connection = nil - - def self.connection - @@shared_connection || retrieve_connection - end -end -ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection -``` - ## Asynchronous JavaScript (Ajax and friends) When working with asynchronous JavaScript, you might come across situations