updated for rails4/mongoid4