mongoid/mongoid — pull request #3327 by arthurnn (2013-10-16 04:09:38+00:00)
Title: Autosave reword

This is a rework on the autosave code.
### Why

- Stop using `class_attribute`, as it could cause problems in concurrent environments.
- Only use relations on memory, so no extra queries so be yield.
- Make the autosaved document use the same persistence options as the main doc.
- Add more tests.

This should also fix this issue:
https://github.com/mongoid/mongoid/issues/2863

@durran , would love to get some review on this before I merge.