Module: MongoMapper::Plugins::Equality

Extended by:
ActiveSupport::Concern
Included in:
Document, EmbeddedDocument
Defined in:
lib/mongo_mapper/plugins/equality.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

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

Returns:



13
14
15
# File 'lib/mongo_mapper/plugins/equality.rb', line 13

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

#hashObject



18
19
20
# File 'lib/mongo_mapper/plugins/equality.rb', line 18

def hash
  _id.hash
end