Fix interactions between `:before_add` callbacks and nested attributes assignment of `has_many` associations, when the association is not yet loaded.
See CHANGELOG for details.

Improved Tests and Fix by Ben Woosley (see PR 11525)