@DawidJanczak wrote:
Hello,
I was wondering if it’s possible to apply a macro to each element of an array that is itself nested in an array. Consider the following structure
optional(:rooms).array(:hash) do required(:guests).array(:hash, GuestSchema) end
I’d like to apply a pre-existing macro to each guest in such a structure. If
rooms
wasn’t array, but a hash I could just dorule(rooms: :guests).each(:macro)
, but in case of array that doesn’t seem to work. I’m also unable to call a macro from within arule(:rooms).each
block.