aldeed/meteor-collection2 — pull request #96 by czeslaaw (2014-08-01 00:35:35+00:00)
Title: Fix for documents with prototype.

I think I discover bug while using collection2 with documents that was changed by transform function.

When my transform function change object from plain js object to object with prototype i got this error on insert:
```
Exception while invoking method '/UniContentTest/insert' TypeError: Cannot call method 'depend' of undefined
at SimpleSchemaValidationContext.keyErrorMessage (packages/simple-schema/simple-schema-context.js:169)
at getErrorObject (packages/collection2/collection2.js:460)
at doValidate (packages/collection2/collection2.js:447)
at self.deny.insert (packages/collection2/collection2.js:214)
```

And it seems to be caused by underscore _.clone() that clone object to one "level" copy with all prototype properties from original object. This happened after cleaning function so this additional fields goes to function that does validation and make it fail in unexpected way. I think validating prototype properties is not something that people usually want. And if it is, I think it should be handle by cleaning function first so this extra fields can be discarded and not causing errors.

Instead of using underscore clone i use simple loop for this part and it seems to fix my problem.