Class: ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::StatementPool

Inherits:
StatementPool show all
Defined in:
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb

Overview

:nodoc:

Constant Summary

Constants inherited from StatementPool

StatementPool::DEFAULT_STATEMENT_LIMIT

Instance Method Summary collapse

Methods inherited from StatementPool

#[], #clear, #delete, #each, #key?, #length

Methods included from Enumerable

#as_json, #compact_blank, #exclude?, #excluding, #including, #index_by, #index_with, #many?, #pluck, #sum, #without

Constructor Details

#initialize(connection, max) ⇒ StatementPool


216
217
218
219
220
# File 'activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb', line 216

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

Instance Method Details

#[]=(sql, key) ⇒ Object


226
227
228
# File 'activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb', line 226

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

#next_keyObject


222
223
224
# File 'activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb', line 222

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