Permalink
Browse files

Fix Issue 194.

  • Loading branch information...
amangale authored and bkeepers committed Jun 27, 2011
1 parent c16b203 commit 5957d7ec285ff657f05c633f47c5ef8d45902a6e
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/mongo_mapper/plugins/keys.rb
@@ -193,7 +193,7 @@ def attributes=(attrs)
def attributes
HashWithIndifferentAccess.new.tap do |attrs|
- keys.each_pair do |name, key|
+ keys.select { |name,key| !self[key.name].nil? }.each_pair do |name, key|
value = key.set(self[key.name])
attrs[name] = value
end
@@ -322,3 +322,4 @@ def write_key(name, value)
end
end
end
+

0 comments on commit 5957d7e

Please sign in to comment.