ebryn/ember-model — pull request #137 by alanctkc (2013-07-14 06:59:00+00:00)
Title: createAndBind method for adding objects to RecordArrays on creation

As mentioned in #9, here's a first stab at offering the ability to create a model instance and instantaneously add it to RecordArrays without waiting for save.

I opted to create a new method, `createAndBind()`, rather than overloading `create` in order to preserve the API for users who already rely on the current `create()` behavior.

Each instance now also tracks its own `isAdded` state, so it's never added twice when `save()` is called after `createAndBind()`.

And, actually, I just checked and realized this is still in 0.0.4, so if you'd prefer to make the API change, I can send a PR for the `create()` overload with the `addToRecordArrays()` call dropped from the `save()` method.