method

save_has_one_association

save_has_one_association(reflection)
private

Saves the associated record if it’s new or :autosave is enabled on the association.

In addition, it will destroy the association if it was marked for destruction with mark_for_destruction.

This all happens inside a transaction, if the Transactions module is included into ActiveRecord::Base after the AutosaveAssociation module, which it does by default.