Sha256: fb0299c85768f03c427fe4fb1d8ec2d85da6d6a6a1c5f228ca49e4086d25d216

Contents?: true

Size: 449 Bytes

Versions: 1

Compression:

Stored size: 449 Bytes

Contents

module MongoMapper
  module Plugins
    module Equality
      extend ActiveSupport::Concern
      module InstanceMethods
        def ==(other)
          other.is_a?(self.class) && _id == other._id
        end
        
        def eql?(other)
          self == other
        end
        
        def equal?(other)
          object_id === other.object_id
        end
        
        def hash
          _id.hash
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mongo_mapper-rails3-0.7.0.1 lib/mongo_mapper/plugins/equality.rb