Method: ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#initialize
- Defined in:
- lib/active_record/connection_adapters/postgresql_adapter.rb
#initialize(connection, logger, connection_parameters, config) ⇒ PostgreSQLAdapter
Initializes and connects a PostgreSQL adapter.
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 |
# File 'lib/active_record/connection_adapters/postgresql_adapter.rb', line 251 def initialize(connection, logger, connection_parameters, config) super(connection, logger) @connection_parameters, @config = connection_parameters, config # @local_tz is initialized as nil to avoid warnings when connect tries to use it @local_tz = nil @table_alias_length = nil @statements = {} connect if postgresql_version < 80200 raise "Your version of PostgreSQL (#{postgresql_version}) is too old, please upgrade!" end @local_tz = execute('SHOW TIME ZONE', 'SCHEMA').first["TimeZone"] end |