Module: MongoMapper::Plugins::Equality::InstanceMethods

Defined in:
lib/mongo_mapper/plugins/equality.rb

Instance Method Summary collapse

Instance Method Details

#eql?(other) ⇒ Boolean Also known as: ==

Returns:



6
7
8
# File 'lib/mongo_mapper/plugins/equality.rb', line 6

def eql?(other)
  other.is_a?(self.class) && _id == other._id
end

#hashObject



11
12
13
# File 'lib/mongo_mapper/plugins/equality.rb', line 11

def hash
  _id.hash
end