jamesarosen/ember-cpm — pull request #11 by mmun (2013-10-08 22:59:30+00:00)
Title: [WIP] Add groupBy

An implementation of groupBy. It returns an instance of Ember.Map whose keys are the various value being grouped on and whose values are arrays of elements corresponding to the groups.

Usage:

```javascript
Game = Em.Object.extend({
players: null,
teams: EmberCPM.Macros.groupBy('players', 'team')
});

game = Game.create({
players: [
Em.O({name: 'Jack', team: 'red'}),
Em.O({name: 'James', team: 'red'}),
Em.O({name: 'Jacob, team: 'blue'}),
Em.O({name: 'Jeremy', team: 'blue'})
]
});

teams = game.get('teams'); // instance of Ember.Map
teams.get('red').mapBy('name'); // ["Jack", "James"]
```