Skip to content
Michael Grosser edited this page Dec 7, 2019 · 3 revisions

try https://github.com/DocSpring/spring-commands-parallel-tests

DEPRECATED BELOW

Patch spring to reconnect the database and then force-enabled it by running with DISABLE_SPRING=0

# config/spring.rb
require 'spring/application'

class Spring::Application
  alias connect_database_orig connect_database

  def connect_database
    disconnect_database
    reconfigure_database
    connect_database_orig
  end

  def reconfigure_database
    if active_record_configured?
      ActiveRecord::Base.configurations =
        Rails.application.config.database_configuration
    end
  end
end

( ͡° ͜ʖ ͡°) ¯_(ツ)_/¯

Clone this wiki locally