Fix rails 4 regression