Support rails 3.1.0+