Sha256: 95695f65cd511ec061f1fd4c08ce3b49429e094f8ffb70e09854993e30bd4254

Contents?: true

Size: 451 Bytes

Versions: 8

Compression:

Stored size: 451 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

8 entries across 8 versions & 1 rubygems

Version Path
ibm_db-5.2.0-x86-mingw32 test/support/connection_helper.rb
ibm_db-5.1.0-x86-mingw32 test/support/connection_helper.rb
ibm_db-5.0.5-x86-mingw32 test/support/connection_helper.rb
ibm_db-5.0.4-x86-mingw32 test/support/connection_helper.rb
ibm_db-5.0.3-x86-mingw32 test/support/connection_helper.rb
ibm_db-5.0.2-x86-mingw32 test/support/connection_helper.rb
ibm_db-3.0.5-x86-mingw32 test/support/connection_helper.rb
ibm_db-3.0.5 test/support/connection_helper.rb