byroot / activerecord-typedstore

ActiveRecord::Store but with type definition
MIT License
439 stars 57 forks source link

Assigning a hash on the store do not coerce it properly #10

Closed byroot closed 10 years ago

byroot commented 10 years ago

e.g.

>> model = Model.new
>> model.settings.class #=> Model::SettingsHash
>> model.settings = {}
>> model.settings.class # => Hash

I though the :coder option of serialize was supposed to coerce on assignation, but that's not the case. We need to decorate the accessor.

/cc @arthurn

coveralls commented 10 years ago

Coverage Status

Coverage decreased (-6.09%) when pulling dfc8eb1a5d3bd12d7e8cec8839300f213a476488 on whole-hash-assignation into d429f9977457d91f835702f59f7821d6037986ac on master.