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
I would like to propose that we add a note to the README that the Hash filter typecasts to HashWithIndifferentAccess.
I was asked to provide support in a case where someone was using interactors as accumulators by mutating the input. While my recommendation would always be to avoid doing this and think more functionally, it was quite jarring to find that even unstripped hashes get typecast. I ended up having to step through the source of ActiveInteraction to understand why their code wasn't working.
To be honest, I would prefer if typecasting wasn't performed on objects that are already in the correct type because it's quite jarring to find the variable has been redefined. I am making an assumption, however, that people now rely upon the current behaviour and that would be too breaking of a change. At least, if the unexpected behaviour was documented, it would be simple to debug
The text was updated successfully, but these errors were encountered:
I would like to propose that we add a note to the README that the Hash filter typecasts to HashWithIndifferentAccess.
I was asked to provide support in a case where someone was using interactors as accumulators by mutating the input. While my recommendation would always be to avoid doing this and think more functionally, it was quite jarring to find that even unstripped hashes get typecast. I ended up having to step through the source of ActiveInteraction to understand why their code wasn't working.
For a contrived example:
To be honest, I would prefer if typecasting wasn't performed on objects that are already in the correct type because it's quite jarring to find the variable has been redefined. I am making an assumption, however, that people now rely upon the current behaviour and that would be too breaking of a change. At least, if the unexpected behaviour was documented, it would be simple to debug
The text was updated successfully, but these errors were encountered: