Sha256: ff991d73b353378d20b636b5c8c5a7a541b64d50ded44d281fcb0d494411fff6

Contents?: true

Size: 794 Bytes

Versions: 186

Compression:

Stored size: 794 Bytes

Contents

# frozen_string_literal: true

module ActiveRecord
  module ConnectionAdapters
    module PostgreSQL
      module OID # :nodoc:
        class Vector < Type::Value # :nodoc:
          attr_reader :delim, :subtype

          # +delim+ corresponds to the `typdelim` column in the pg_types
          # table.  +subtype+ is derived from the `typelem` column in the
          # pg_types table.
          def initialize(delim, subtype)
            @delim   = delim
            @subtype = subtype
          end

          # FIXME: this should probably split on +delim+ and use +subtype+
          # to cast the values.  Unfortunately, the current Rails behavior
          # is to just return the string.
          def cast(value)
            value
          end
        end
      end
    end
  end
end

Version data entries

186 entries across 181 versions & 14 rubygems

Version Path
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/activerecord-7.0.3.1/lib/active_record/connection_adapters/postgresql/oid/vector.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/activerecord-7.0.2.3/lib/active_record/connection_adapters/postgresql/oid/vector.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/postgresql/oid/vector.rb
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4/lib/active_record/connection_adapters/postgresql/oid/vector.rb
activerecord-7.0.5 lib/active_record/connection_adapters/postgresql/oid/vector.rb
activerecord-7.0.4.3 lib/active_record/connection_adapters/postgresql/oid/vector.rb
activerecord-6.1.7.3 lib/active_record/connection_adapters/postgresql/oid/vector.rb
rubypitaya-3.12.4 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4/lib/active_record/connection_adapters/postgresql/oid/vector.rb
activerecord-6.1.7.2 lib/active_record/connection_adapters/postgresql/oid/vector.rb
activerecord-7.0.4.2 lib/active_record/connection_adapters/postgresql/oid/vector.rb
rubypitaya-3.12.3 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4/lib/active_record/connection_adapters/postgresql/oid/vector.rb
activerecord-7.0.4.1 lib/active_record/connection_adapters/postgresql/oid/vector.rb
activerecord-6.1.7.1 lib/active_record/connection_adapters/postgresql/oid/vector.rb
activerecord-6.0.6.1 lib/active_record/connection_adapters/postgresql/oid/vector.rb
rubypitaya-3.12.2 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4/lib/active_record/connection_adapters/postgresql/oid/vector.rb
activerecord-7.0.4 lib/active_record/connection_adapters/postgresql/oid/vector.rb
activerecord-6.1.7 lib/active_record/connection_adapters/postgresql/oid/vector.rb
activerecord-6.0.6 lib/active_record/connection_adapters/postgresql/oid/vector.rb
activerecord-7.0.3.1 lib/active_record/connection_adapters/postgresql/oid/vector.rb
activerecord-6.1.6.1 lib/active_record/connection_adapters/postgresql/oid/vector.rb