Sha256: ac596a357069a7bc0b6ee2d3c731e5e150ca5189261e2051307d0992e8b646cc

Contents?: true

Size: 279 Bytes

Versions: 19

Compression:

Stored size: 279 Bytes

Contents

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

  def self.connection
    @@shared_connection || ConnectionPool::Wrapper.new(size: 1) { retrieve_connection }
  end
end

ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
ab_admin-0.11.0 lib/generators/ab_admin/install/templates/spec/support/shared_connection.rb
ab_admin-0.10.0 lib/generators/ab_admin/install/templates/spec/support/shared_connection.rb
ab_admin-0.9.0 lib/generators/ab_admin/install/templates/spec/support/shared_connection.rb
ab_admin-0.8.3 lib/generators/ab_admin/install/templates/spec/support/shared_connection.rb
ab_admin-0.8.2 lib/generators/ab_admin/install/templates/spec/support/shared_connection.rb
ab_admin-0.8.1 lib/generators/ab_admin/install/templates/spec/support/shared_connection.rb
ab_admin-0.8.0 lib/generators/ab_admin/install/templates/spec/support/shared_connection.rb
ab_admin-0.7.0 lib/generators/ab_admin/install/templates/spec/support/shared_connection.rb
ab_admin-0.6.1 lib/generators/ab_admin/install/templates/spec/support/shared_connection.rb
ab_admin-0.6.0 lib/generators/ab_admin/install/templates/spec/support/shared_connection.rb
ab_admin-0.5.0 lib/generators/ab_admin/install/templates/spec/support/shared_connection.rb
ab_admin-0.4.0 lib/generators/ab_admin/install/templates/spec/support/shared_connection.rb
ab_admin-0.3.6 lib/generators/ab_admin/install/templates/spec/support/shared_connection.rb
ab_admin-0.3.5 lib/generators/ab_admin/install/templates/spec/support/shared_connection.rb
ab_admin-0.3.4 lib/generators/ab_admin/install/templates/spec/support/shared_connection.rb
ab_admin-0.3.3 lib/generators/ab_admin/install/templates/spec/support/shared_connection.rb
ab_admin-0.3.2 lib/generators/ab_admin/install/templates/spec/support/shared_connection.rb
ab_admin-0.3.1 lib/generators/ab_admin/install/templates/spec/support/shared_connection.rb
ab_admin-0.3.0 lib/generators/ab_admin/install/templates/spec/support/shared_connection.rb