Sha256: 189c9f5e155b2181b98fe2d36bbfe4e51197a55807e2e13414d3a46da82d8bba

Contents?: true

Size: 437 Bytes

Versions: 20

Compression:

Stored size: 437 Bytes

Contents

module ConnectionHelper
  def run_without_connection
    original_connection = ActiveRecord::Base.remove_connection
    yield original_connection
  ensure
    ActiveRecord::Base.establish_connection(original_connection)
  end

  # Used to drop all cache query plans in tests.
  def reset_connection
    original_connection = ActiveRecord::Base.remove_connection
    ActiveRecord::Base.establish_connection(original_connection)
  end
end

Version data entries

20 entries across 20 versions & 3 rubygems

Version Path
ibm_db-5.2.0 test/support/connection_helper.rb
ibm_db-5.1.0 test/support/connection_helper.rb
ibm_db-5.0.5 test/support/connection_helper.rb
ibm_db-5.0.4 test/support/connection_helper.rb
ibm_db-5.0.3 test/support/connection_helper.rb
ibm_db-5.0.2 test/support/connection_helper.rb
ibm_db-4.0.0-x86-mingw32 test/support/connection_helper.rb
ibm_db-4.0.0 test/support/connection_helper.rb
ibm_db-3.0.4-x86-mingw32 test/support/connection_helper.rb
ibm_db-3.0.4 test/support/connection_helper.rb
ibm_db-3.0.3-x86-mingw32 test/support/connection_helper.rb
ibm_db-3.0.3 test/support/connection_helper.rb
ibm_db-3.0.2-x86-mingw32 test/support/connection_helper.rb
ibm_db-3.0.2 test/support/connection_helper.rb
activejob-lock-0.0.2 rails/activerecord/test/support/connection_helper.rb
ibm_db-3.0.1 test/support/connection_helper.rb
ibm_db-3.0.1-x86-mingw32 test/support/connection_helper.rb
activerecord-string-enum-0.0.2 test/support/connection_helper.rb
activerecord-string-enum-0.0.1 test/support/connection_helper.rb
activejob-lock-0.0.1 rails/activerecord/test/support/connection_helper.rb