Adding support for ActiveRecord 4.2

In ActiveRecord 4.2 `@attributes` is no longer a simple Hash, but an undocumented `AttributeSet`. See individual commits for more information.