GitHub User: kozak
You can also use just one shared db connection as mentioned on:
@@shared_connection = nil
@@shared_connection || retrieve_connection
# Forces all threads to share the same connection. This works on
# Capybara because it starts the web server in a thread.
ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection