lib/sequel/extensions/pg_array.rb
def register_array_type(db_type, opts=OPTS, &block)
          opts = {:type_procs=>conversion_procs, :typecast_method_map=>@pg_array_schema_types, :typecast_methods_module=>(class << self; self; end)}.merge(opts)
          unless (opts.has_key?(:scalar_oid) || block) && opts.has_key?(:oid)
            array_oid, scalar_oid = from(:pg_type).where(:typname=>db_type.to_s).get([:typarray, :oid])
            opts[:scalar_oid] = scalar_oid unless opts.has_key?(:scalar_oid) || block
            opts[:oid] = array_oid unless opts.has_key?(:oid)
          end
          PGArray.register(db_type, opts, &block)
          @schema_type_classes[:"#{opts[:typecast_method] || opts[:type_symbol] || db_type}_array"] = PGArray
        end
# Register a database specific array type.  This can be used to support
# different array types per Database.  Use of this method does not
# affect global state, unlike PGArray.register.  See PGArray.register for
# possible options.
Register a database specific array type.  This can be used to support
different array types per Database.  Use of this method does not
affect global state, unlike PGArray.register.  See PGArray.register for
possible options.
Register a database specific array type . This can be used to support different array types per Database . Use of this method does not affect global state unlike PGArray . register . See PGArray . register for possible options .
def register_array_type(db_type, opts=OPTS, &block)
          opts = {:type_procs=>conversion_procs, :typecast_method_map=>@pg_array_schema_types, :typecast_methods_module=>(class << self; self; end)}.merge(opts)
          unless (opts.has_key?(:scalar_oid) || block) && opts.has_key?(:oid)
            array_oid, scalar_oid = from(:pg_type).where(:typname=>db_type.to_s).get([:typarray, :oid])
            opts[:scalar_oid] = scalar_oid unless opts.has_key?(:scalar_oid) || block
            opts[:oid] = array_oid unless opts.has_key?(:oid)
          end
          PGArray.register(db_type, opts, &block)
          @schema_type_classes[:"#{opts[:typecast_method] || opts[:type_symbol] || db_type}_array"] = PGArray
        end
def register_array_type ( db_type , opts = OPTS , & block ) opts = { :type_procs => conversion_procs , :typecast_method_map => @pg_array_schema_types , :typecast_methods_module => ( class << self ; self ; end ) } . merge ( opts ) unless ( opts . has_key? ( :scalar_oid ) || block ) && opts . has_key? ( :oid ) array_oid , scalar_oid = from ( :pg_type ) . where ( :typname => db_type . to_s ) . get ( [ :typarray , :oid ] ) opts [ :scalar_oid ] = scalar_oid unless opts . has_key? ( :scalar_oid ) || block opts [ :oid ] = array_oid unless opts . has_key? ( :oid ) end PGArray . register ( db_type , opts , & block ) @schema_type_classes [ :" #{ opts [ :typecast_method ] || opts [ :type_symbol ] || db_type } _array " ] = PGArray end
Register a database specific array type.
Register a database specific array type .
db_type
opts
block