Sha256: 1eba68e0770335fa9cb37ef0458dc9e15a43e1155d10de13bb7cf846023b4c13
Contents?: true
Size: 880 Bytes
Versions: 34
Compression:
Stored size: 880 Bytes
Contents
# frozen_string_literal: true module ActiveRecord module ConnectionAdapters class PostgreSQLTypeMetadata < DelegateClass(SqlTypeMetadata) undef to_yaml if method_defined?(:to_yaml) attr_reader :oid, :fmod, :array def initialize(type_metadata, oid: nil, fmod: nil) super(type_metadata) @type_metadata = type_metadata @oid = oid @fmod = fmod @array = /\[\]$/.match?(type_metadata.sql_type) end def sql_type super.gsub(/\[\]$/, "".freeze) end def ==(other) other.is_a?(PostgreSQLTypeMetadata) && attributes_for_hash == other.attributes_for_hash end alias eql? == def hash attributes_for_hash.hash end protected def attributes_for_hash [self.class, @type_metadata, oid, fmod] end end end end
Version data entries
34 entries across 34 versions & 4 rubygems