Sha256: 90ea6a45a1429a8e92e389d147b8aa20ef453b036763ddfba09f52be6da11c02

Contents?: true

Size: 881 Bytes

Versions: 36

Compression:

Stored size: 881 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) &&
          sql_type == other.sql_type &&
          type == other.type &&
          limit == other.limit &&
          precision == other.precision &&
          scale == other.scale
      end
      alias eql? ==

      def hash
        SqlTypeMetadata.hash ^
          sql_type.hash ^
          type.hash ^
          limit.hash ^
          precision.hash >> 1 ^
          scale.hash >> 2
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 4 rubygems

Version Path
activerecord-6.0.6.1 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-6.0.6 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-6.0.5.1 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-6.0.5 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-6.0.4.8 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-6.0.4.7 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-6.0.4.6 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-6.0.4.5 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-6.0.4.4 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-6.0.4.3 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-6.0.4.2 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-6.0.4.1 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-6.0.4 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-6.0.3.7 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-6.0.3.6 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-6.0.3.5 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-6.0.3.4 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-6.0.3.3 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-6.0.3.2 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-6.0.3.1 lib/active_record/connection_adapters/sql_type_metadata.rb