assign_nested_attributes_for_one_to_one_association
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8 (0)
- 3.0.0 (-1)
- 3.0.9 (-3)
- 3.1.0 (0)
- 3.2.1 (0)
- 3.2.8 (0)
- 3.2.13 (0)
- 4.0.2 (38)
- 4.1.8 (0)
- 4.2.1 (0)
- 4.2.7 (0)
- 4.2.9 (0)
- 5.0.0.1 (0)
- 5.1.7 (0)
- 5.2.3 (0)
- 6.0.0 (0)
- 6.1.3.1 (0)
- 6.1.7.7 (0)
- 7.0.0 (0)
- 7.1.3.2 (0)
- What's this?
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.