Sha256: d5e7a3654f965050ea16548990c46f1a6464dbd9ba308c1796949c06c00c04d8

Contents?: true

Size: 919 Bytes

Versions: 50

Compression:

Stored size: 919 Bytes

Contents

# This implements a basic decoder to work around ActiveRecord's dependence on the pg gem
module ActiveRecord::ConnectionAdapters::PostgreSQL::OID
  class Array < ActiveModel::Type::Value
    module PG
      module TextDecoder
        class Array
          # Loads pg_array_parser if available. String parsing can be
          # performed quicker by a native extension, which will not create
          # a large amount of Ruby objects that will need to be garbage
          # collected. pg_array_parser has a C and Java extension
          begin
            require 'pg_array_parser'
            include PgArrayParser
          rescue LoadError
            require_relative 'array_parser'
            include ActiveRecord::ConnectionAdapters::PostgreSQL::ArrayParser
          end

          def initialize(name:, delimiter:); end

          alias_method :decode, :parse_pg_array
        end
      end
    end
  end
end

Version data entries

50 entries across 50 versions & 3 rubygems

Version Path
activerecord-jdbc-adapter-52.8-java lib/arjdbc/postgresql/base/array_decoder.rb
activerecord-jdbc-alt-adapter-52.6.0-java lib/arjdbc/postgresql/base/array_decoder.rb
activerecord-jdbc-alt-adapter-51.7.0-java lib/arjdbc/postgresql/base/array_decoder.rb
activerecord-jdbc-alt-adapter-50.7.0-java lib/arjdbc/postgresql/base/array_decoder.rb
activerecord-jdbc-adapter-52.7-java lib/arjdbc/postgresql/base/array_decoder.rb
activerecord-jdbc-adapter-51.8-java lib/arjdbc/postgresql/base/array_decoder.rb
activerecord-jdbc-adapter-50.8-java lib/arjdbc/postgresql/base/array_decoder.rb
activerecord-jdbc-adapter-52.6-java lib/arjdbc/postgresql/base/array_decoder.rb
activerecord-jdbc-adapter-51.7-java lib/arjdbc/postgresql/base/array_decoder.rb
activerecord-jdbc-adapter-50.7-java lib/arjdbc/postgresql/base/array_decoder.rb
activerecord-jdbc-alt-adapter-52.5.1-java lib/arjdbc/postgresql/base/array_decoder.rb
activerecord-jdbc-alt-adapter-51.6.1-java lib/arjdbc/postgresql/base/array_decoder.rb
activerecord-jdbc-alt-adapter-50.6.1-java lib/arjdbc/postgresql/base/array_decoder.rb
activerecord-jdbc-adapter-52.5-java lib/arjdbc/postgresql/base/array_decoder.rb
activerecord-jdbc-adapter-51.6-java lib/arjdbc/postgresql/base/array_decoder.rb
activerecord-jdbc-adapter-50.6-java lib/arjdbc/postgresql/base/array_decoder.rb
activerecord-jdbc-alt-adapter-52.4.0-java lib/arjdbc/postgresql/base/array_decoder.rb
activerecord-jdbc-alt-adapter-51.5.0-java lib/arjdbc/postgresql/base/array_decoder.rb
activerecord-jdbc-alt-adapter-50.5.0-java lib/arjdbc/postgresql/base/array_decoder.rb
activerecord-jdbc-adapter-52.4-java lib/arjdbc/postgresql/base/array_decoder.rb