Class: ActiveRecord::ConnectionAdapters::OvirtLegacyPostgreSQLAdapter::StatementPool

Inherits:
ConnectionAdapters::StatementPool
  • Object
show all
Defined in:
lib/active_record/connection_adapters/ovirt_legacy_postgresql_adapter.rb

Instance Method Summary collapse

Constructor Details

#initialize(connection, max) ⇒ StatementPool

Returns a new instance of StatementPool.



193
194
195
196
197
# File 'lib/active_record/connection_adapters/ovirt_legacy_postgresql_adapter.rb', line 193

def initialize(connection, max)
  super(max)
  @connection = connection
  @counter = 0
end

Instance Method Details

#[]=(sql, key) ⇒ Object



203
204
205
# File 'lib/active_record/connection_adapters/ovirt_legacy_postgresql_adapter.rb', line 203

def []=(sql, key)
  super.tap { @counter += 1 }
end

#next_keyObject



199
200
201
# File 'lib/active_record/connection_adapters/ovirt_legacy_postgresql_adapter.rb', line 199

def next_key
  "a#{@counter + 1}"
end