Merge pull request #12135 from dylanahsmith/avoid_empty_transaction

Avoid empty transaction from setting has_one association on new record.

Conflicts:
	activerecord/CHANGELOG.md

Conflicts:
	activerecord/CHANGELOG.md