mattgreen/nitron — pull request #17 by macfanatic (2012-06-26 16:15:55+00:00)
Title: Basic callback support, callbacks only called on calling model, not on r...

Here's a clean request that includes the callback support, rebased off master as of today.

See the README for usage.

Note that the callbacks are only called on the object triggering the callback. The callbacks don't cascade, ie:

```ruby
c = Consignor.first
c.destroy # Any relationships on this, set to cascade in Xcode, will be removed - yet the "before_destroy" callbacks on those models aren't triggered, since "destroy" wasn't actually called on those models.
```

Could investigate re-working somewhat with `willSave` method on `NSManagedObject`, but I don't think that will cleanly solve the issue. The other more complicated way would be to traverse the object graph & call the appropriate callbacks on the relationships by hand.