support rails >= 3.0.0, < 3.2.0