added the support for mongoid-4