Fix rails 4 incompatibility (fixes #7)