cinch-financial/mongoose-encryption — pull request #2 by homeyer (2014-08-14 00:06:22+00:00)
Title: support embedded documents

Using `mongoose-encryption` on embedded documents doesn't currently work; the embedded document doesn't decrypt on `find`s.

According to [this issue](https://github.com/LearnBoost/mongoose/issues/1079) on mongoose, the pre init hook for embedded documents requires you to return the updated value, instead of calling next. To make that work, `decrypt` was also changed to be synchronous. Added new tests to cover embedded docs.