fix mongoid scopes and indexes