support rails 3 and 3.1