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.

Thanks to @zflat for contributing PR #169 which led to this PR.