When calling to_hon an event, if the data attribute contains a nested hash, the nested hashes will remain frozen. To fix this we can use Marshal.load(Marshal.dump(@attributes)) instead of @attributes.dup. Alternatively, we could clone deep_dup from Rails, though it does miss some edge cases.
I have a PR prepared if you would like me to submit it.
When calling
to_h
on an event, if thedata
attribute contains a nested hash, the nested hashes will remain frozen. To fix this we can useMarshal.load(Marshal.dump(@attributes))
instead of@attributes.dup
. Alternatively, we could clonedeep_dup
from Rails, though it does miss some edge cases.I have a PR prepared if you would like me to submit it.