Treat rails 4 the same as rails 3