audiosocket/mediator — pull request #4 by toots (2013-02-27 00:24:01+00:00)
Title: Enhance many parser..

Changed `many` parse to stick to the following rules:

* if `subj.foos = nil` then `subj.foos` is set to `[]`
* If `subj.foos = [ {id: 1234, ...}, ...]` then `p.many` with data `[{id: 1234, ...}, ...]` updates element with `id` `1234` in `subj.foos`
* if `subj.foos` does not have element with `id` `1234` then `p.many` with data `[{id: 1234, ...}, ...]` creates a new element in `subj.foos` with `id` `1234`.
* If `p.many` is called with option `replace: true` then `subj.foos` is set to `[]` before parsing data.

The above relies on the fact that `def construct` is given and is smart re: for instance `create :foos` and `create :foo`.