Rails 4.2 has deprecated `serialized_attributes`

* Use the new `type_for_attribute` method instead
Merge pull request #2140 from iwz/serialized_attributes-rails-4.2

Rails 4.2 has deprecated `serialized_attributes`