Sha256: f255feb4ac2ea511bc5885b3635affdf98473bb05eca67f457cd0bab5e2b6e54

Contents?: true

Size: 760 Bytes

Versions: 37

Compression:

Stored size: 760 Bytes

Contents

# frozen_string_literal: true

module ActiveRecord
  # :stopdoc:
  module ConnectionAdapters
    class SqlTypeMetadata
      attr_reader :sql_type, :type, :limit, :precision, :scale

      def initialize(sql_type: nil, type: nil, limit: nil, precision: nil, scale: nil)
        @sql_type = sql_type
        @type = type
        @limit = limit
        @precision = precision
        @scale = scale
      end

      def ==(other)
        other.is_a?(SqlTypeMetadata) &&
          attributes_for_hash == other.attributes_for_hash
      end
      alias eql? ==

      def hash
        attributes_for_hash.hash
      end

      protected

        def attributes_for_hash
          [self.class, sql_type, type, limit, precision, scale]
        end
    end
  end
end

Version data entries

37 entries across 37 versions & 4 rubygems

Version Path
activerecord-5.2.8.1 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.2.8 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.2.7.1 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.2.7 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.2.6.3 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.2.6.2 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.2.6.1 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.2.6 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.2.4.6 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.2.5 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.2.4.5 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.2.4.4 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.2.4.3 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.2.4.2 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.2.4.1 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.2.4 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.2.4.rc1 lib/active_record/connection_adapters/sql_type_metadata.rb
spiral_form-0.1.1 vendor/bundle/gems/activerecord-5.2.3/lib/active_record/connection_adapters/sql_type_metadata.rb
spiral_form-0.1.0 vendor/bundle/gems/activerecord-5.2.3/lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.2.3 lib/active_record/connection_adapters/sql_type_metadata.rb