assign_nested_attributes_for_one_to_one_association(association_name, attributes) private

Assigns the given attributes to the association.

If update_only is false and the given attributes include an :id that matches the existing record’s id, then the existing record will be modified. If update_only is true, a new record is only created when no object exists. Otherwise a new record will be built.

If the given attributes include a matching :id attribute, or update_only is true, and a :_destroy key set to a truthy value, then the existing record will be marked for destruction.

Show source
Register or log in to add new notes.