Question: I'm building a Rails app that uses MongoDB as the backend, with Mongoid as the ODM. I've found it very useful, but I'm looking for a good way to keep track of the following:

* Updating objects (Mike changed the price from 50 to 75)
* Creating objects (Dan added a comment on Mike's post)
* Basic stats (Mike's post was viewed 10 times and edited 3 times)

Any recommendations for libraries to use?

Thanks!

Answer: 
Try the mongoid-history and trackoid gems. The first allows you to track changes and the latter allows you to track activity.

<https://github.com/aq1018/mongoid-history>

<https://github.com/twoixter/trackoid>
just use public activity gem. It supports rails 3 and 4 and mongoid embedded documents