Don’t override already-defined default values when freezing #240

Merged
merged 3 commits into from Jan 31, 2014

2 participants

@amarshall
  • Freezing a Virtus object no longer overwrites all existing default attribute values.
  • Add Attribute#defined? to cleanup AttributeSet#skip_default? a bit.
  • Make AttributeSet#set_default_attributes! behavior respect its documentation, which implied its only difference from set_default_attributes was that it additionally set lazy attributes, which was not entirely true since it also set non-lazy (and lazy) attributes that had already been defined.
amarshall added some commits Jan 31, 2014
@amarshall amarshall Add Attribute#defined? to return if attribute value has been defined d84f4df
@amarshall amarshall Use Attribute#default? in AttributeSet#skip_default? 67ca515
@amarshall amarshall Don’t override already-defined default values when freezing
Further, make `AttributeSet#set_default_attributes!` behavior respect
its documentation, which implied its only difference from
`set_default_attributes` was that it additionally set lazy attributes,
which was not entirely true since it also set non-lazy (and lazy)
attributes that had already been defined.
c16ab82
@solnic solnic merged commit 45ef710 into solnic:master Jan 31, 2014

1 check passed

Details default The Travis CI build passed
@solnic
Owner

@amarshall thank you Andrew for the patch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment