Sha256: 555a099eb99abcabc073458a28adaa2550c3f8a33df556c455825598b03b2e43

Contents?: true

Size: 360 Bytes

Versions: 16

Compression:

Stored size: 360 Bytes

Contents

class ActiveRecord::Base
  mattr_accessor :shared_connection
  @@shared_connection = nil

  def self.connection
    @@shared_connection || retrieve_connection
  end
end

# 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

Version data entries

16 entries across 16 versions & 4 rubygems

Version Path
message_train-0.5.2 spec/support/shared_connection.rb
message_train-0.5.1 spec/support/shared_connection.rb
message_train-0.5.0 spec/support/shared_connection.rb
spree_minicart-1.1.3 spec/support/shared_connection.rb
spree_minicart-1.1.2 spec/support/shared_connection.rb
spree_minicart-1.1.1 spec/support/shared_connection.rb
spree_paypal_express-1.1.0 spec/support/shared_connection.rb
spree_size_chart-1.1.1 spec/support/shared_connection.rb
spree_minicart-1.0.0 spec/support/shared_connection.rb
spree_minicart-1.1.0 spec/support/shared_connection.rb
spree_size_chart-1.1.0 spec/support/shared_connection.rb
spree_size_chart-1.0.0 spec/support/shared_connection.rb
spree_minicart-0.0.4 spec/support/shared_connection.rb
spree_minicart-0.0.3 spec/support/shared_connection.rb
spree_minicart-0.0.2 spec/support/shared_connection.rb
spree_minicart-0.0.1 spec/support/shared_connection.rb