FineLinePrototyping/angularjs-rails-resource — pull request #143 by shuhei (2014-12-19 11:11:37+00:00)
Title: serialization: Add custom attribute to collection items

Currently we can add custom attribute to single item but not to collection items.

For example, this works:

```js
this.serializeWith('book', factory(function() {
this.add('publisherId', function(book) {
return book.publisher.id;
});
}));
```

But this doesn't (let's say `books` is an array):

```js
this.serializeWith('books', factory(function() {
this.add('publisherId', function(book) {
return book.publisher.id;
});
}));
```

Other methods like `rename()` works with collection items and I have many use cases of `add()` with them. This pull request makes `add()` work too.