class ActiveRecord::ConnectionAdapters::PostgreSQL::Column
:nodoc:
def ==(other)
def ==(other) other.is_a?(Column) && super && identity? == other.identity? && serial? == other.serial? end
def array
def array sql_type_metadata.sql_type.end_with?("[]") end
def auto_incremented_by_db?
def auto_incremented_by_db? serial? || identity? end
def encode_with(coder)
def encode_with(coder) coder["serial"] = @serial coder["identity"] = @identity coder["generated"] = @generated super end
def enum?
def enum? type == :enum end
def has_default?
def has_default? super && !virtual? end
def hash
def hash Column.hash ^ super.hash ^ identity?.hash ^ serial?.hash end
def identity?
def identity? @identity end
def init_with(coder)
def init_with(coder) @serial = coder["serial"] @identity = coder["identity"] @generated = coder["generated"] super end
def initialize(*, serial: nil, identity: nil, generated: nil, **)
def initialize(*, serial: nil, identity: nil, generated: nil, **) super @serial = serial @identity = identity @generated = generated end
def serial?
def serial? @serial end
def sql_type
def sql_type super.delete_suffix("[]") end
def virtual?
def virtual? # We assume every generated column is virtual, no matter the concrete type @generated.present? end