Update for rails 4.1.7
Merge pull request #253 from tomhughes/rails417

Update for rails 4.1.7