github/Mantle — pull request #163 by jilouc (2013-10-14 13:49:00+00:00)
Title: Ensure that relationships are updated for an object matching a uniqueness constraint

Previously, objects in a relationship are added/updated, but they are not deleted if not present in the model's relationship anymore.

Simple case to reproduce the issue:

**Parent**
* uniqueId (used for the uniquing predicate)
* children (to many relationship to Child)

**Child**
* uniqueId (again, used the uniquing predicate)
* name (string)
* parent (to one relationship to Parent)

I insert a Parent with id 1 and children with ids 100, 101, 102.

````objc
Parent *p1 = [MTLManagedObjectAdapter managedObjectFromModel:parentModel insertingIntoContext:context error:&error];
````

And now, I have the same parent (id 1), but with children ids 100, 102, 103.

````objc
Parent *p2 = [MTLManagedObjectAdapter managedObjectFromModel:parentModel insertingIntoContext:context error:&error];
````

Here `p2.children` contains all 4 children 100, **101**, 102 and 103

* new children are added
* existing children are updated if needed
* but **deleted children are still here**