Fix Rails 3 incompatibility