[WIP] Upgrade to rails master/4.2

I was going to send this when I have the complete set of patches required, but I noticed @SamSaffron has started working on it too, so we should probably share notes :smile:
I feel like we had to do something similar on a past project and had a solution that wasn't completely terrible. @derekprior do you remember what it was?