Sha256: f4cbcc6bf2a8ab6f2bb93179bff7c7808fe9b4fd522381ab80f7d3192e4e59ac

Contents?: true

Size: 729 Bytes

Versions: 20

Compression:

Stored size: 729 Bytes

Contents

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

20 entries across 20 versions & 1 rubygems

Version Path
activerecord-5.1.7 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.1.7.rc1 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.1.6.2 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.1.6.1 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.1.6 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.1.5 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.1.5.rc1 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.1.4 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.1.4.rc1 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.1.3 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.1.3.rc3 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.1.3.rc2 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.1.3.rc1 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.1.2 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.1.2.rc1 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.1.1 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.1.0 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.1.0.rc2 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.1.0.rc1 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.1.0.beta1 lib/active_record/connection_adapters/sql_type_metadata.rb