Use proper objects to do the work of building associations.

Mirroring:
https://github.com/rails/rails/commit/52f8e4b9dae6137fcd95793dffc26ddff80b623e