make rails 3.1 compatible