{"action":"created","comment":{"url":"https://api.github.com/repos/sphereio/sphere-product-import/pulls/comments/33247743","id":33247743,"diff_hunk":"@@ -182,6 +186,71 @@ class ProductImport\n   _generateUniqueToken: ->\n     _.uniqueId \"#{new Date().getTime()}\"\n \n+  _fetchAndResolveCustomReferences: (product) =>\n+    new Promise (resolve) =>\n+      if product.masterVariant\n+        @_fetchAndResolveCustomReferencesByVariant(product.masterVariant).then (result) -> product.masterVariant = result\n+\n+      if product.variants\n+        Promise.map product.variants, (variant) =>\n+          @_fetchAndResolveCustomReferencesByVariant(variant)\n+          .then ->\n+            Promise.resolve()\n+        ,{concurrency: 5}\n+      resolve(product)","path":"lib/product-import.coffee","position":55,"original_position":55,"commit_id":"5df674b8ad9c832d02ccc6609b22766677b828ac","original_commit_id":"7d0f5ef60bbb25db48ce542ceb3bfdcfddd363f1","user":{"login":"emmenko","id":1110551,"avatar_url":"https://avatars.githubusercontent.com/u/1110551?v=3","gravatar_id":"","url":"https://api.github.com/users/emmenko","html_url":"https://github.com/emmenko","followers_url":"https://api.github.com/users/emmenko/followers","following_url":"https://api.github.com/users/emmenko/following{/other_user}","gists_url":"https://api.github.com/users/emmenko/gists{/gist_id}","starred_url":"https://api.github.com/users/emmenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emmenko/subscriptions","organizations_url":"https://api.github.com/users/emmenko/orgs","repos_url":"https://api.github.com/users/emmenko/repos","events_url":"https://api.github.com/users/emmenko/events{/privacy}","received_events_url":"https://api.github.com/users/emmenko/received_events","type":"User","site_admin":false},"body":"```coffeescript\r\n_fetchAndResolveCustomReferences: (product) =>\r\n  Promise.all [\r\n    @_fetchAndResolveCustomReferencesByVariant(product.masterVariant),\r\n    Promise.map product.variants, (variant) =>\r\n      @_fetchAndResolveCustomReferencesByVariant(variant)\r\n    ,{concurrency: 5}\r\n  ].spread(masterVariant, variants) -> \r\n    Promise.resolve _.extend(product, { masterVariant, variants })\r\n```","created_at":"2015-06-25T12:13:20Z","updated_at":"2015-06-25T12:13:20Z","html_url":"https://github.com/sphereio/sphere-product-import/pull/11#discussion_r33247743","pull_request_url":"https://api.github.com/repos/sphereio/sphere-product-import/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/sphereio/sphere-product-import/pulls/comments/33247743"},"html":{"href":"https://github.com/sphereio/sphere-product-import/pull/11#discussion_r33247743"},"pull_request":{"href":"https://api.github.com/repos/sphereio/sphere-product-import/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/sphereio/sphere-product-import/pulls/11","id":38362429,"html_url":"https://github.com/sphereio/sphere-product-import/pull/11","diff_url":"https://github.com/sphereio/sphere-product-import/pull/11.diff","patch_url":"https://github.com/sphereio/sphere-product-import/pull/11.patch","issue_url":"https://api.github.com/repos/sphereio/sphere-product-import/issues/11","number":11,"state":"open","locked":false,"title":"Custom reference attributes resolution","user":{"login":"panshul007","id":745298,"avatar_url":"https://avatars.githubusercontent.com/u/745298?v=3","gravatar_id":"","url":"https://api.github.com/users/panshul007","html_url":"https://github.com/panshul007","followers_url":"https://api.github.com/users/panshul007/followers","following_url":"https://api.github.com/users/panshul007/following{/other_user}","gists_url":"https://api.github.com/users/panshul007/gists{/gist_id}","starred_url":"https://api.github.com/users/panshul007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/panshul007/subscriptions","organizations_url":"https://api.github.com/users/panshul007/orgs","repos_url":"https://api.github.com/users/panshul007/repos","events_url":"https://api.github.com/users/panshul007/events{/privacy}","received_events_url":"https://api.github.com/users/panshul007/received_events","type":"User","site_admin":false},"body":"* Fetches all attributes having a reference as value\r\n* Resolves the reference based on the provided predicate and endpoint\r\n* replaces the reference object with the resolved id in the attribute  ","created_at":"2015-06-23T17:36:35Z","updated_at":"2015-06-25T12:13:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d58772a7da28c97cf47c4c85760d5daa2a8830da","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sphereio/sphere-product-import/pulls/11/commits","review_comments_url":"https://api.github.com/repos/sphereio/sphere-product-import/pulls/11/comments","review_comment_url":"https://api.github.com/repos/sphereio/sphere-product-import/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sphereio/sphere-product-import/issues/11/comments","statuses_url":"https://api.github.com/repos/sphereio/sphere-product-import/statuses/5df674b8ad9c832d02ccc6609b22766677b828ac","head":{"label":"sphereio:product-reference","ref":"product-reference","sha":"5df674b8ad9c832d02ccc6609b22766677b828ac","user":{"login":"sphereio","id":4119130,"avatar_url":"https://avatars.githubusercontent.com/u/4119130?v=3","gravatar_id":"","url":"https://api.github.com/users/sphereio","html_url":"https://github.com/sphereio","followers_url":"https://api.github.com/users/sphereio/followers","following_url":"https://api.github.com/users/sphereio/following{/other_user}","gists_url":"https://api.github.com/users/sphereio/gists{/gist_id}","starred_url":"https://api.github.com/users/sphereio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sphereio/subscriptions","organizations_url":"https://api.github.com/users/sphereio/orgs","repos_url":"https://api.github.com/users/sphereio/repos","events_url":"https://api.github.com/users/sphereio/events{/privacy}","received_events_url":"https://api.github.com/users/sphereio/received_events","type":"Organization","site_admin":false},"repo":{"id":34815423,"name":"sphere-product-import","full_name":"sphereio/sphere-product-import","owner":{"login":"sphereio","id":4119130,"avatar_url":"https://avatars.githubusercontent.com/u/4119130?v=3","gravatar_id":"","url":"https://api.github.com/users/sphereio","html_url":"https://github.com/sphereio","followers_url":"https://api.github.com/users/sphereio/followers","following_url":"https://api.github.com/users/sphereio/following{/other_user}","gists_url":"https://api.github.com/users/sphereio/gists{/gist_id}","starred_url":"https://api.github.com/users/sphereio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sphereio/subscriptions","organizations_url":"https://api.github.com/users/sphereio/orgs","repos_url":"https://api.github.com/users/sphereio/repos","events_url":"https://api.github.com/users/sphereio/events{/privacy}","received_events_url":"https://api.github.com/users/sphereio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sphereio/sphere-product-import","description":"Manage product data","fork":false,"url":"https://api.github.com/repos/sphereio/sphere-product-import","forks_url":"https://api.github.com/repos/sphereio/sphere-product-import/forks","keys_url":"https://api.github.com/repos/sphereio/sphere-product-import/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sphereio/sphere-product-import/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sphereio/sphere-product-import/teams","hooks_url":"https://api.github.com/repos/sphereio/sphere-product-import/hooks","issue_events_url":"https://api.github.com/repos/sphereio/sphere-product-import/issues/events{/number}","events_url":"https://api.github.com/repos/sphereio/sphere-product-import/events","assignees_url":"https://api.github.com/repos/sphereio/sphere-product-import/assignees{/user}","branches_url":"https://api.github.com/repos/sphereio/sphere-product-import/branches{/branch}","tags_url":"https://api.github.com/repos/sphereio/sphere-product-import/tags","blobs_url":"https://api.github.com/repos/sphereio/sphere-product-import/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sphereio/sphere-product-import/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sphereio/sphere-product-import/git/refs{/sha}","trees_url":"https://api.github.com/repos/sphereio/sphere-product-import/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sphereio/sphere-product-import/statuses/{sha}","languages_url":"https://api.github.com/repos/sphereio/sphere-product-import/languages","stargazers_url":"https://api.github.com/repos/sphereio/sphere-product-import/stargazers","contributors_url":"https://api.github.com/repos/sphereio/sphere-product-import/contributors","subscribers_url":"https://api.github.com/repos/sphereio/sphere-product-import/subscribers","subscription_url":"https://api.github.com/repos/sphereio/sphere-product-import/subscription","commits_url":"https://api.github.com/repos/sphereio/sphere-product-import/commits{/sha}","git_commits_url":"https://api.github.com/repos/sphereio/sphere-product-import/git/commits{/sha}","comments_url":"https://api.github.com/repos/sphereio/sphere-product-import/comments{/number}","issue_comment_url":"https://api.github.com/repos/sphereio/sphere-product-import/issues/comments{/number}","contents_url":"https://api.github.com/repos/sphereio/sphere-product-import/contents/{+path}","compare_url":"https://api.github.com/repos/sphereio/sphere-product-import/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sphereio/sphere-product-import/merges","archive_url":"https://api.github.com/repos/sphereio/sphere-product-import/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sphereio/sphere-product-import/downloads","issues_url":"https://api.github.com/repos/sphereio/sphere-product-import/issues{/number}","pulls_url":"https://api.github.com/repos/sphereio/sphere-product-import/pulls{/number}","milestones_url":"https://api.github.com/repos/sphereio/sphere-product-import/milestones{/number}","notifications_url":"https://api.github.com/repos/sphereio/sphere-product-import/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sphereio/sphere-product-import/labels{/name}","releases_url":"https://api.github.com/repos/sphereio/sphere-product-import/releases{/id}","created_at":"2015-04-29T20:01:14Z","updated_at":"2015-06-03T08:11:17Z","pushed_at":"2015-06-25T10:38:46Z","git_url":"git://github.com/sphereio/sphere-product-import.git","ssh_url":"git@github.com:sphereio/sphere-product-import.git","clone_url":"https://github.com/sphereio/sphere-product-import.git","svn_url":"https://github.com/sphereio/sphere-product-import","homepage":null,"size":416,"stargazers_count":1,"watchers_count":1,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":10,"forks":0,"open_issues":10,"watchers":1,"default_branch":"master"}},"base":{"label":"sphereio:master","ref":"master","sha":"da563458918eefc37598ebd42f5041590a4d48dc","user":{"login":"sphereio","id":4119130,"avatar_url":"https://avatars.githubusercontent.com/u/4119130?v=3","gravatar_id":"","url":"https://api.github.com/users/sphereio","html_url":"https://github.com/sphereio","followers_url":"https://api.github.com/users/sphereio/followers","following_url":"https://api.github.com/users/sphereio/following{/other_user}","gists_url":"https://api.github.com/users/sphereio/gists{/gist_id}","starred_url":"https://api.github.com/users/sphereio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sphereio/subscriptions","organizations_url":"https://api.github.com/users/sphereio/orgs","repos_url":"https://api.github.com/users/sphereio/repos","events_url":"https://api.github.com/users/sphereio/events{/privacy}","received_events_url":"https://api.github.com/users/sphereio/received_events","type":"Organization","site_admin":false},"repo":{"id":34815423,"name":"sphere-product-import","full_name":"sphereio/sphere-product-import","owner":{"login":"sphereio","id":4119130,"avatar_url":"https://avatars.githubusercontent.com/u/4119130?v=3","gravatar_id":"","url":"https://api.github.com/users/sphereio","html_url":"https://github.com/sphereio","followers_url":"https://api.github.com/users/sphereio/followers","following_url":"https://api.github.com/users/sphereio/following{/other_user}","gists_url":"https://api.github.com/users/sphereio/gists{/gist_id}","starred_url":"https://api.github.com/users/sphereio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sphereio/subscriptions","organizations_url":"https://api.github.com/users/sphereio/orgs","repos_url":"https://api.github.com/users/sphereio/repos","events_url":"https://api.github.com/users/sphereio/events{/privacy}","received_events_url":"https://api.github.com/users/sphereio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sphereio/sphere-product-import","description":"Manage product data","fork":false,"url":"https://api.github.com/repos/sphereio/sphere-product-import","forks_url":"https://api.github.com/repos/sphereio/sphere-product-import/forks","keys_url":"https://api.github.com/repos/sphereio/sphere-product-import/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sphereio/sphere-product-import/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sphereio/sphere-product-import/teams","hooks_url":"https://api.github.com/repos/sphereio/sphere-product-import/hooks","issue_events_url":"https://api.github.com/repos/sphereio/sphere-product-import/issues/events{/number}","events_url":"https://api.github.com/repos/sphereio/sphere-product-import/events","assignees_url":"https://api.github.com/repos/sphereio/sphere-product-import/assignees{/user}","branches_url":"https://api.github.com/repos/sphereio/sphere-product-import/branches{/branch}","tags_url":"https://api.github.com/repos/sphereio/sphere-product-import/tags","blobs_url":"https://api.github.com/repos/sphereio/sphere-product-import/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sphereio/sphere-product-import/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sphereio/sphere-product-import/git/refs{/sha}","trees_url":"https://api.github.com/repos/sphereio/sphere-product-import/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sphereio/sphere-product-import/statuses/{sha}","languages_url":"https://api.github.com/repos/sphereio/sphere-product-import/languages","stargazers_url":"https://api.github.com/repos/sphereio/sphere-product-import/stargazers","contributors_url":"https://api.github.com/repos/sphereio/sphere-product-import/contributors","subscribers_url":"https://api.github.com/repos/sphereio/sphere-product-import/subscribers","subscription_url":"https://api.github.com/repos/sphereio/sphere-product-import/subscription","commits_url":"https://api.github.com/repos/sphereio/sphere-product-import/commits{/sha}","git_commits_url":"https://api.github.com/repos/sphereio/sphere-product-import/git/commits{/sha}","comments_url":"https://api.github.com/repos/sphereio/sphere-product-import/comments{/number}","issue_comment_url":"https://api.github.com/repos/sphereio/sphere-product-import/issues/comments{/number}","contents_url":"https://api.github.com/repos/sphereio/sphere-product-import/contents/{+path}","compare_url":"https://api.github.com/repos/sphereio/sphere-product-import/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sphereio/sphere-product-import/merges","archive_url":"https://api.github.com/repos/sphereio/sphere-product-import/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sphereio/sphere-product-import/downloads","issues_url":"https://api.github.com/repos/sphereio/sphere-product-import/issues{/number}","pulls_url":"https://api.github.com/repos/sphereio/sphere-product-import/pulls{/number}","milestones_url":"https://api.github.com/repos/sphereio/sphere-product-import/milestones{/number}","notifications_url":"https://api.github.com/repos/sphereio/sphere-product-import/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sphereio/sphere-product-import/labels{/name}","releases_url":"https://api.github.com/repos/sphereio/sphere-product-import/releases{/id}","created_at":"2015-04-29T20:01:14Z","updated_at":"2015-06-03T08:11:17Z","pushed_at":"2015-06-25T10:38:46Z","git_url":"git://github.com/sphereio/sphere-product-import.git","ssh_url":"git@github.com:sphereio/sphere-product-import.git","clone_url":"https://github.com/sphereio/sphere-product-import.git","svn_url":"https://github.com/sphereio/sphere-product-import","homepage":null,"size":416,"stargazers_count":1,"watchers_count":1,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":10,"forks":0,"open_issues":10,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sphereio/sphere-product-import/pulls/11"},"html":{"href":"https://github.com/sphereio/sphere-product-import/pull/11"},"issue":{"href":"https://api.github.com/repos/sphereio/sphere-product-import/issues/11"},"comments":{"href":"https://api.github.com/repos/sphereio/sphere-product-import/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/sphereio/sphere-product-import/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/sphereio/sphere-product-import/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sphereio/sphere-product-import/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/sphereio/sphere-product-import/statuses/5df674b8ad9c832d02ccc6609b22766677b828ac"}}}}