123456789_123456789_123456789_123456789_123456789_

Class: ActiveRecord::ConnectionAdapters::ConnectionPool::Lease

Do not use. This class is for internal use only.

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.newLease

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb', line 144

def initialize
  @connection = nil
  @sticky = nil
end

Instance Attribute Details

#connection (rw)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb', line 142

attr_accessor :connection, :sticky

#sticky (rw)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb', line 142

attr_accessor :connection, :sticky

Instance Method Details

#clear(connection)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb', line 156

def clear(connection)
  if @connection == connection
    @connection = nil
    @sticky = nil
    true
  else
    false
  end
end

#release

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb', line 149

def release
  conn = @connection
  @connection = nil
  @sticky = nil
  conn
end