byroot / activerecord-typedstore

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

Const the coder so we can Marshal the model #31

Closed arthurnn closed 9 years ago

arthurnn commented 9 years ago

without this fix the test fail like so:

 1) MarshalTypedStoreModel it should behave like any model Marshal.dump dumps the model
     Failure/Error: Marshal.dump(model)
     TypeError:
       can't dump anonymous class #<Class:0x007fae5b9b02d8>
     Shared Example Group: "any model" called from ./spec/active_record/typed_store_spec.rb:746
     # ./spec/active_record/typed_store_spec.rb:20:in `dump'
     # ./spec/active_record/typed_store_spec.rb:20:in `block (3 levels) in <top (required)>'

I guess this only happens for rails 4.2 as the test seems to pass on 4.1

review @byroot

coveralls commented 9 years ago

Coverage Status

Coverage increased (+0.01%) to 98.38% when pulling 73f1f560585f7158c247ef3dd866eb18f051a986 on arthurnn:const_coder into 062b430284c0ace96fc6270570ce2655b34c0566 on byroot:master.

coveralls commented 9 years ago

Coverage Status

Coverage increased (+0.01%) to 98.38% when pulling 73f1f560585f7158c247ef3dd866eb18f051a986 on arthurnn:const_coder into 062b430284c0ace96fc6270570ce2655b34c0566 on byroot:master.

coveralls commented 9 years ago

Coverage Status

Coverage increased (+0.01%) to 98.38% when pulling 21b2276113f0c3b4987caf779e83a8c3a1243b50 on arthurnn:const_coder into 062b430284c0ace96fc6270570ce2655b34c0566 on byroot:master.

coveralls commented 9 years ago

Coverage Status

Coverage increased (+0.01%) to 98.38% when pulling 21b2276113f0c3b4987caf779e83a8c3a1243b50 on arthurnn:const_coder into 062b430284c0ace96fc6270570ce2655b34c0566 on byroot:master.

byroot commented 9 years ago

As discussed offline, this change seem to be on purpose on Rails side. So I'll merge this.