An array
filter can mutate the state of the passed in Array instance
#545
Labels
array
filter can mutate the state of the passed in Array instance
#545
During an upgrade from 4.1 to 5.1.1 we noticed a small change in behavior when using an
array
filter that transforms its values. It looks like the call tomap!
inArrayFilter#process
will mutate the original array passed into the interaction. This raises errors in cases when the original array is frozen as well as some ActiveRecord interactions (e.g., being passed a list ID's and then saving the object those ID's belong to).I've written a script below to reproduce this behavior:
When run under version 4.1 the output is:
When run under version 5.1 the output is:
The text was updated successfully, but these errors were encountered: