Modified for devise and mongoid