Fix rails 4 incompatibility