Namespace
Methods
A
R
Constants
TYPE_MAP = TypeMap.new # :nodoc:
 
NAMES = Hash.new { |h,k| # :nodoc: h[k] = OID::Identity.new }
 

When the PG adapter connects, the pg_type table is queried. The key of this hash maps to the `typname` column from the table. TYPE_MAP is then dynamically built with oids as the key and type objects as values.

Class Public methods
alias_type(new, old)

Alias the oldtype to the newtype.

# File activerecord/lib/active_record/connection_adapters/postgresql/oid.rb, line 310
def self.alias_type(new, old)
  NAMES[new] = NAMES[old]
end
register_type(name, type)

Register an OID type named namewith a typcasting object in type. nameshould correspond to the `typname` column in the `pg_type` table.

# File activerecord/lib/active_record/connection_adapters/postgresql/oid.rb, line 305
def self.register_type(name, type)
  NAMES[name] = type
end
registered_type?(name)

Is namea registered type?

# File activerecord/lib/active_record/connection_adapters/postgresql/oid.rb, line 315
def self.registered_type?(name)
  NAMES.key? name
end