Sagnac effect in ring lasers and ring resonators. How does the refractive index of the optical medium influence the sensitivity to rotation