Sha256: 0d9f5227e07b4ebeda9441b034a6a5882e7f9ff232e67a83e5b44eaa421fb674

Contents?: true

Size: 361 Bytes

Versions: 8

Compression:

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

8 entries across 8 versions & 2 rubygems

Version Path
remotipart-1.4.4 spec/support/connection_helper.rb
remotipart-1.4.3 spec/support/connection_helper.rb
active_admin_jcrop-0.0.10 spec/support/active_record.rb
active_admin_jcrop-0.0.9 spec/support/active_record.rb
active_admin_jcrop-0.0.7 spec/support/active_record.rb
active_admin_jcrop-0.0.6 spec/support/active_record.rb
active_admin_jcrop-0.0.5 spec/support/active_record.rb
active_admin_jcrop-0.0.4 spec/support/active_record.rb