Fix for mongoid 3.1