Class: PGTrunk::Adapters::Postgres::Connection

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/pg_trunk/core/adapters/postgres.rb

Overview

Decorates an ActiveRecord connection with methods that help determine the connections capabilities.

Every attempt is made to use the versions of these methods defined by Rails where they are available and public before falling back to our own implementations for older Rails versions.

Instance Method Summary collapse

Instance Method Details

#check_constraint_name(table, expression) ⇒ Object

Expose private method helpers



33
34
35
36
37
38
39
# File 'lib/pg_trunk/core/adapters/postgres.rb', line 33

def check_constraint_name(table, expression)
  __getobj__.send(
    :check_constraint_name,
    table,
    expression: expression,
  )
end

#server_versionObject



27
28
29
# File 'lib/pg_trunk/core/adapters/postgres.rb', line 27

def server_version
  raw_connection.server_version.to_s
end

#strip_table_name(table) ⇒ Object



41
42
43
# File 'lib/pg_trunk/core/adapters/postgres.rb', line 41

def strip_table_name(table)
  __getobj__.send(:strip_table_name_prefix_and_suffix, table)
end