Sha256: 1ebc0ef28f5e56eddfb81a933705e312e2fd8a917a20e46a031bc03a8a172130

Contents?: true

Size: 723 Bytes

Versions: 35

Compression:

Stored size: 723 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

35 entries across 35 versions & 4 rubygems

Version Path
autocompl-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/sql_type_metadata.rb
abaci-0.3.0 vendor/bundle/gems/activerecord-5.0.0/lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.0.1 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.0.1.rc2 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.0.1.rc1 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.0.0.1 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.0.0 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.0.0.rc2 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.0.0.racecar1 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.0.0.rc1 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.0.0.beta4 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.0.0.beta3 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.0.0.beta2 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.0.0.beta1.1 lib/active_record/connection_adapters/sql_type_metadata.rb
activerecord-5.0.0.beta1 lib/active_record/connection_adapters/sql_type_metadata.rb