{"action":"created","issue":{"url":"https://api.github.com/repos/FineLinePrototyping/angularjs-rails-resource/issues/143","labels_url":"https://api.github.com/repos/FineLinePrototyping/angularjs-rails-resource/issues/143/labels{/name}","comments_url":"https://api.github.com/repos/FineLinePrototyping/angularjs-rails-resource/issues/143/comments","events_url":"https://api.github.com/repos/FineLinePrototyping/angularjs-rails-resource/issues/143/events","html_url":"https://github.com/FineLinePrototyping/angularjs-rails-resource/pull/143","id":52472138,"number":143,"title":"serialization: Add custom attribute to collection items","user":{"login":"shuhei","id":498635,"avatar_url":"https://avatars.githubusercontent.com/u/498635?v=3","gravatar_id":"","url":"https://api.github.com/users/shuhei","html_url":"https://github.com/shuhei","followers_url":"https://api.github.com/users/shuhei/followers","following_url":"https://api.github.com/users/shuhei/following{/other_user}","gists_url":"https://api.github.com/users/shuhei/gists{/gist_id}","starred_url":"https://api.github.com/users/shuhei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shuhei/subscriptions","organizations_url":"https://api.github.com/users/shuhei/orgs","repos_url":"https://api.github.com/users/shuhei/repos","events_url":"https://api.github.com/users/shuhei/events{/privacy}","received_events_url":"https://api.github.com/users/shuhei/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2014-12-19T11:11:37Z","updated_at":"2015-02-07T18:34:06Z","closed_at":"2015-02-07T14:05:49Z","pull_request":{"url":"https://api.github.com/repos/FineLinePrototyping/angularjs-rails-resource/pulls/143","html_url":"https://github.com/FineLinePrototyping/angularjs-rails-resource/pull/143","diff_url":"https://github.com/FineLinePrototyping/angularjs-rails-resource/pull/143.diff","patch_url":"https://github.com/FineLinePrototyping/angularjs-rails-resource/pull/143.patch"},"body":"Currently we can add custom attribute to single item but not to collection items.\r\n\r\nFor example, this works:\r\n\r\n```js\r\nthis.serializeWith('book', factory(function() {\r\n    this.add('publisherId', function(book) {\r\n        return book.publisher.id;\r\n    });\r\n}));\r\n```\r\n\r\nBut this doesn't (let's say `books` is an array):\r\n\r\n```js\r\nthis.serializeWith('books', factory(function() {\r\n    this.add('publisherId', function(book) {\r\n        return book.publisher.id;\r\n    });\r\n}));\r\n```\r\n\r\nOther methods like `rename()` works with collection items and I have many use cases of `add()` with them. This pull request makes `add()` work too."},"comment":{"url":"https://api.github.com/repos/FineLinePrototyping/angularjs-rails-resource/issues/comments/73376555","html_url":"https://github.com/FineLinePrototyping/angularjs-rails-resource/pull/143#issuecomment-73376555","issue_url":"https://api.github.com/repos/FineLinePrototyping/angularjs-rails-resource/issues/143","id":73376555,"user":{"login":"CyborgMaster","id":1882579,"avatar_url":"https://avatars.githubusercontent.com/u/1882579?v=3","gravatar_id":"","url":"https://api.github.com/users/CyborgMaster","html_url":"https://github.com/CyborgMaster","followers_url":"https://api.github.com/users/CyborgMaster/followers","following_url":"https://api.github.com/users/CyborgMaster/following{/other_user}","gists_url":"https://api.github.com/users/CyborgMaster/gists{/gist_id}","starred_url":"https://api.github.com/users/CyborgMaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CyborgMaster/subscriptions","organizations_url":"https://api.github.com/users/CyborgMaster/orgs","repos_url":"https://api.github.com/users/CyborgMaster/repos","events_url":"https://api.github.com/users/CyborgMaster/events{/privacy}","received_events_url":"https://api.github.com/users/CyborgMaster/received_events","type":"User","site_admin":false},"created_at":"2015-02-07T18:34:06Z","updated_at":"2015-02-07T18:34:06Z","body":"@Envek, maybe you should open a pull request with just your patch\r\n"}}