Fixed mongoid, devise error after login

See https://github.com/plataformatec/devise/issues/2949