WanWizard / Datamapper

Maintenance of Datamapper has been transferred to https://github.com/saekort/datamapper in 2012.
27 stars 3 forks source link

Allow saving of relationships independently of saving object properties #17

Open froddd opened 12 years ago

froddd commented 12 years ago

In some cases it would be very handy to be able to save a relationship on its own, without saving the object itself as well.

Proposition: adding a separate method for saving relations on their own, eg:

$object->save_related($related_object, $related_key);

and/or, following the previous many different formats for saving objects with multiple relations:

$object->save_related(array('related_key' => $related_objects->all, 'key_2' => $rel_2->all, ...))

Note: this may already be superseded by the new approach to related object validation, feel free to close if so.