@frodsan sure thing, I didn't do this in the first place because the surrounding methods don't have any docs, I'm not sure the method name is proper, and to be honest I'm not 100% sure what this code is actually doing :).

I've extracted it to a method to keep the behaviours when NestedAttributes builds a new record or uses an already built new record, as coherent as possible.

Once I get more feedback on the code, I'll add proper test coverage and docs for that method.