adamtootle/ATMantleCollections — pull request #1 by leeadkins (2013-01-10 19:49:14+00:00)
Title: Renaming the addObject method and making function as expected

When adding an object to a collection, if an object with the same ID already exists, that existing object is discarded and the new object in inserted in its place.

This breaks observers and things that expect to know when an object is updated. So, I've renamed addObject (with Adam's advice) to addOrUpdateObject and use some build in object merging features of Mantle to update the existing object in place instead of completely wiping out the original object.

The #1 caveat of this approach is that all objects in a collection are now required to be the same type. This was sort of an implied thing, but now it should cause a runtime exception if they aren't when an update occurs.