Detect if mongoid and use correct id_partition