lib/collector/repository.rb in collector-0.1.5 vs lib/collector/repository.rb in collector-0.1.6
- old
+ new
@@ -39,10 +39,10 @@
collection.remove(_id: normalize_id(model.id))
end
def serialize!(model)
attributes = serialize(model)
- attributes["_id"] = BSON::ObjectId.from_string(attributes.delete("id")) if attributes["id"]
+ attributes["_id"] = normalize_id(attributes.delete("id")) if attributes["id"]
attributes.reject! { |key, val| val.nil? }
attributes
end
def serialize(model)