Sha256: 3fef5b265b781c4dcaed06b74466a5ca780d185acd28ce8c9f959fb553f46a8a

Contents?: true

Size: 623 Bytes

Versions: 36

Compression:

Stored size: 623 Bytes

Contents

# frozen_string_literal: true

module ActiveRecord
  module ConnectionAdapters
    module PostgreSQL
      class Column < ConnectionAdapters::Column # :nodoc:
        delegate :oid, :fmod, to: :sql_type_metadata

        def initialize(*, serial: nil, **)
          super
          @serial = serial
        end

        def serial?
          @serial
        end

        def array
          sql_type_metadata.sql_type.end_with?("[]")
        end
        alias :array? :array

        def sql_type
          super.sub(/\[\]\z/, "")
        end
      end
    end
    PostgreSQLColumn = PostgreSQL::Column # :nodoc:
  end
end

Version data entries

36 entries across 36 versions & 4 rubygems

Version Path
activerecord-6.0.6.1 lib/active_record/connection_adapters/postgresql/column.rb
activerecord-6.0.6 lib/active_record/connection_adapters/postgresql/column.rb
activerecord-6.0.5.1 lib/active_record/connection_adapters/postgresql/column.rb
activerecord-6.0.5 lib/active_record/connection_adapters/postgresql/column.rb
activerecord-6.0.4.8 lib/active_record/connection_adapters/postgresql/column.rb
activerecord-6.0.4.7 lib/active_record/connection_adapters/postgresql/column.rb
activerecord-6.0.4.6 lib/active_record/connection_adapters/postgresql/column.rb
activerecord-6.0.4.5 lib/active_record/connection_adapters/postgresql/column.rb
activerecord-6.0.4.4 lib/active_record/connection_adapters/postgresql/column.rb
activerecord-6.0.4.3 lib/active_record/connection_adapters/postgresql/column.rb
activerecord-6.0.4.2 lib/active_record/connection_adapters/postgresql/column.rb
activerecord-6.0.4.1 lib/active_record/connection_adapters/postgresql/column.rb
activerecord-6.0.4 lib/active_record/connection_adapters/postgresql/column.rb
activerecord-6.0.3.7 lib/active_record/connection_adapters/postgresql/column.rb
activerecord-6.0.3.6 lib/active_record/connection_adapters/postgresql/column.rb
activerecord-6.0.3.5 lib/active_record/connection_adapters/postgresql/column.rb
activerecord-6.0.3.4 lib/active_record/connection_adapters/postgresql/column.rb
activerecord-6.0.3.3 lib/active_record/connection_adapters/postgresql/column.rb
activerecord-6.0.3.2 lib/active_record/connection_adapters/postgresql/column.rb
activerecord-6.0.3.1 lib/active_record/connection_adapters/postgresql/column.rb