You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Option skip_parse on property is ignored when when corresponding value on input hash is nil.
Expected: when skip_parse: true representer does not try to set any value in represented model
Actual: representer tries to set value if value is nil
it'representable skip_parse nil'doclassTestRepresenter < Representable::Decoratorinclude ::Representable::Hashproperty:property1property:property2,skip_parse: trueendclassTestModelattr_accessor:property1attr_reader:property2definitialize@property1='123'@property2='456'endendm=TestModel.newr=TestRepresenter.new(m)expected_hash={property1: '123',property2: '456'}.stringify_keysexpect(r.to_hash).toeq(expected_hash)new_hash={property1: '789',property2: nil}.stringify_keysr.from_hash(new_hash)# << fails here when trying to set readonly property2expect(m.property1).toeq('789')expect(m.property2).toeq('456')end
The text was updated successfully, but these errors were encountered:
Option
skip_parse
on property is ignored when when corresponding value on input hash is nil.Expected: when
skip_parse: true
representer does not try to set any value in represented modelActual: representer tries to set value if value is nil
The text was updated successfully, but these errors were encountered: