Fixed compatibility problem with new version of mongoid