diff --git a/lib/mongo_mapper/plugins/keys.rb b/lib/mongo_mapper/plugins/keys.rb
index <HASH>..<HASH> 100644
--- a/lib/mongo_mapper/plugins/keys.rb
+++ b/lib/mongo_mapper/plugins/keys.rb
@@ -193,7 +193,7 @@ module MongoMapper
 
         def attributes
           HashWithIndifferentAccess.new.tap do |attrs|
-            keys.select { |name,key| !self[key.name].nil? || key.type == ObjectId }.each_pair do |name, key|
+            keys.select { |name,key| !self[key.name].nil? || key.type == ObjectId }.each do |name, key|
               value = key.set(self[key.name])
               attrs[name] = value
             end
Fix attributes on Ruby <I>

Array#each_pair is not defined