Update to Rails 4.2

#555.

Mostly a straight upgrade. There's one backport from upcoming Rails 4.2.1, and I cleaned up the handling of serialized attributes.