work with both rails 3.2 and 4.0