You can also use just one shared db connection as mentioned on: platformatec-blog
ruby
classActiveRecord::Base
mattr_accessor :shared_connection@@shared_connection = nildefself.connection@@shared_connection || retrieve_connection
endend# 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
You can also use just one shared db connection as mentioned on:
platformatec-blog