Make changes to support rails 4.1.6