Sha256: e8d842244b31e874551f4a2aa3d347cd3a11b18595a1986d4e4693ce4be98224

Contents?: true

Size: 988 Bytes

Versions: 66

Compression:

Stored size: 988 Bytes

Contents

# frozen_string_literal: true

module ActiveRecord
  # :stopdoc:
  module ConnectionAdapters
    module CipherStashPG
      class TypeMetadata < DelegateClass(SqlTypeMetadata)
        undef to_yaml if method_defined?(:to_yaml)

        include Deduplicable

        attr_reader :oid, :fmod

        def initialize(type_metadata, oid: nil, fmod: nil)
          super(type_metadata)
          @oid = oid
          @fmod = fmod
        end

        def ==(other)
          other.is_a?(TypeMetadata) &&
            __getobj__ == other.__getobj__ &&
            oid == other.oid &&
            fmod == other.fmod
        end
        alias eql? ==

        def hash
          TypeMetadata.hash ^
            __getobj__.hash ^
            oid.hash ^
            fmod.hash
        end

        private
          def deduplicated
            __setobj__(__getobj__.deduplicate)
            super
          end
      end
    end
    CipherStashPGTypeMetadata = CipherStashPG::TypeMetadata
  end
end

Version data entries

66 entries across 32 versions & 1 rubygems

Version Path
activerecord-cipherstash-pg-adapter-0.8.5 lib/active_record/connection_adapters/6.1/cipherstash_pg/type_metadata.rb
activerecord-cipherstash-pg-adapter-0.8.5 lib/active_record/connection_adapters/7.0/cipherstash_pg/type_metadata.rb
activerecord-cipherstash-pg-adapter-0.8.5 lib/active_record/connection_adapters/7.1/cipherstash_pg/type_metadata.rb
activerecord-cipherstash-pg-adapter-0.8.4 lib/active_record/connection_adapters/7.0/cipherstash_pg/type_metadata.rb
activerecord-cipherstash-pg-adapter-0.8.4 lib/active_record/connection_adapters/6.1/cipherstash_pg/type_metadata.rb
activerecord-cipherstash-pg-adapter-0.8.4 lib/active_record/connection_adapters/7.1/cipherstash_pg/type_metadata.rb
activerecord-cipherstash-pg-adapter-0.8.3 lib/active_record/connection_adapters/7.0/cipherstash_pg/type_metadata.rb
activerecord-cipherstash-pg-adapter-0.8.3 lib/active_record/connection_adapters/7.1/cipherstash_pg/type_metadata.rb
activerecord-cipherstash-pg-adapter-0.8.3 lib/active_record/connection_adapters/6.1/cipherstash_pg/type_metadata.rb
activerecord-cipherstash-pg-adapter-0.8.2 lib/active_record/connection_adapters/7.0/cipherstash_pg/type_metadata.rb
activerecord-cipherstash-pg-adapter-0.8.2 lib/active_record/connection_adapters/6.1/cipherstash_pg/type_metadata.rb
activerecord-cipherstash-pg-adapter-0.8.2 lib/active_record/connection_adapters/7.1/cipherstash_pg/type_metadata.rb
activerecord-cipherstash-pg-adapter-0.8.1 lib/active_record/connection_adapters/7.0/cipherstash_pg/type_metadata.rb
activerecord-cipherstash-pg-adapter-0.8.1 lib/active_record/connection_adapters/6.1/cipherstash_pg/type_metadata.rb
activerecord-cipherstash-pg-adapter-0.8.0 lib/active_record/connection_adapters/6.1/cipherstash_pg/type_metadata.rb
activerecord-cipherstash-pg-adapter-0.8.0 lib/active_record/connection_adapters/7.0/cipherstash_pg/type_metadata.rb
activerecord-cipherstash-pg-adapter-0.7.19 lib/active_record/connection_adapters/6.1/cipherstash_pg/type_metadata.rb
activerecord-cipherstash-pg-adapter-0.7.19 lib/active_record/connection_adapters/7.0/cipherstash_pg/type_metadata.rb
activerecord-cipherstash-pg-adapter-0.7.18 lib/active_record/connection_adapters/7.0/cipherstash_pg/type_metadata.rb
activerecord-cipherstash-pg-adapter-0.7.18 lib/active_record/connection_adapters/6.1/cipherstash_pg/type_metadata.rb