Fix rails 3 incompatibility