Adding compability with new versions of mongoid