Sha256: f436a30406fdda631f369fda9debd52cae505eba166cfb12b727021f76875483

Contents?: true

Size: 293 Bytes

Versions: 60

Compression:

Stored size: 293 Bytes

Contents

# encoding: UTF-8
module MongoMapper
  module Plugins
    module Equality
      module InstanceMethods
        def eql?(other)
          other.is_a?(self.class) && _id == other._id
        end
        alias :== :eql?

        def hash
          _id.hash
        end
      end
    end
  end
end

Version data entries

60 entries across 60 versions & 7 rubygems

Version Path
mongo_mapper-unstable-2010.08.08 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.08.06 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.08.05 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.08.04 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.08.03 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.08.02 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.08.01 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.07.31 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.07.30 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.07.29 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.07.28 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.07.27 lib/mongo_mapper/plugins/equality.rb
thorsson-mongo_mapper-0.8.2 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.07.26 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.07.23 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.07.21 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.07.20 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.07.19 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.07.18 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.07.16 lib/mongo_mapper/plugins/equality.rb