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
If you have say, a Collection.of(Attributor::Hash) ... you can easily initialize an instance by calling the .load method. That will propertly load/coerce/convert the elements to the appropriate type (i.e. Attributor::Hash in this case).
However, if you add an element to it (i.e. using <<) we'll blindly store the instance you pass without loading it. Same applies for any native Array methods that set/change elements.
I think we need to override those "settable/updatable" functions and force a load first.
Otherwise, it might look like you're setting the right things (i.e., a ruby Hash, instead of an Attributor::Hash) as one of the elements...but which will then fail validation. Same for Strings vs. Symbols...etc
The text was updated successfully, but these errors were encountered:
If you have say, a Collection.of(Attributor::Hash) ... you can easily initialize an instance by calling the .load method. That will propertly load/coerce/convert the elements to the appropriate type (i.e. Attributor::Hash in this case).
However, if you add an element to it (i.e. using
<<
) we'll blindly store the instance you pass without loading it. Same applies for any native Array methods that set/change elements.I think we need to override those "settable/updatable" functions and force a load first.
Otherwise, it might look like you're setting the right things (i.e., a ruby Hash, instead of an Attributor::Hash) as one of the elements...but which will then fail validation. Same for Strings vs. Symbols...etc
The text was updated successfully, but these errors were encountered: