{"action":"created","comment":{"url":"https://api.github.com/repos/wombat/quickbooks_integration/pulls/comments/39221858","id":39221858,"diff_hunk":"@@ -32,7 +37,7 @@ def find_or_create_by_sku(line_item, account = nil)\n           income_account_id: account ? account.id : nil\n         }\n \n-        find_by_sku(name) || create(params)\n+        find_by_name(name) || find_by_sku(name) || create(params)","path":"lib/qb_integration/services/item.rb","position":23,"original_position":23,"commit_id":"3a46dc30f2193cbfa5c8e903f6d4e3c3935497dd","original_commit_id":"3a46dc30f2193cbfa5c8e903f6d4e3c3935497dd","user":{"login":"phstc","id":105652,"avatar_url":"https://avatars.githubusercontent.com/u/105652?v=3","gravatar_id":"","url":"https://api.github.com/users/phstc","html_url":"https://github.com/phstc","followers_url":"https://api.github.com/users/phstc/followers","following_url":"https://api.github.com/users/phstc/following{/other_user}","gists_url":"https://api.github.com/users/phstc/gists{/gist_id}","starred_url":"https://api.github.com/users/phstc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phstc/subscriptions","organizations_url":"https://api.github.com/users/phstc/orgs","repos_url":"https://api.github.com/users/phstc/repos","events_url":"https://api.github.com/users/phstc/events{/privacy}","received_events_url":"https://api.github.com/users/phstc/received_events","type":"User","site_admin":false},"body":"hey @adaddeo can it be `find_by_sku(name) || find_by_name(name) || create(params)` just to keep it more consistent with the previous implementation?","created_at":"2015-09-10T22:21:15Z","updated_at":"2015-09-10T22:21:15Z","html_url":"https://github.com/wombat/quickbooks_integration/pull/5#discussion_r39221858","pull_request_url":"https://api.github.com/repos/wombat/quickbooks_integration/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/wombat/quickbooks_integration/pulls/comments/39221858"},"html":{"href":"https://github.com/wombat/quickbooks_integration/pull/5#discussion_r39221858"},"pull_request":{"href":"https://api.github.com/repos/wombat/quickbooks_integration/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/wombat/quickbooks_integration/pulls/5","id":44482336,"html_url":"https://github.com/wombat/quickbooks_integration/pull/5","diff_url":"https://github.com/wombat/quickbooks_integration/pull/5.diff","patch_url":"https://github.com/wombat/quickbooks_integration/pull/5.patch","issue_url":"https://api.github.com/repos/wombat/quickbooks_integration/issues/5","number":5,"state":"open","locked":false,"title":"Find by name or sku","user":{"login":"adaddeo","id":1143517,"avatar_url":"https://avatars.githubusercontent.com/u/1143517?v=3","gravatar_id":"","url":"https://api.github.com/users/adaddeo","html_url":"https://github.com/adaddeo","followers_url":"https://api.github.com/users/adaddeo/followers","following_url":"https://api.github.com/users/adaddeo/following{/other_user}","gists_url":"https://api.github.com/users/adaddeo/gists{/gist_id}","starred_url":"https://api.github.com/users/adaddeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adaddeo/subscriptions","organizations_url":"https://api.github.com/users/adaddeo/orgs","repos_url":"https://api.github.com/users/adaddeo/repos","events_url":"https://api.github.com/users/adaddeo/events{/privacy}","received_events_url":"https://api.github.com/users/adaddeo/received_events","type":"User","site_admin":false},"body":"This is untested, as I had trouble running the tests.\r\n\r\nQuickbooks has added in a separate attribute on products and services called SKU. So now name is to be used as the actual name \"Spree T-Shirt\" and sku is to be used as the sku \"ST-001\".\r\n\r\nThis looks up by both to support both old/new users.","created_at":"2015-09-08T20:59:52Z","updated_at":"2015-09-10T22:21:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"19de8836f607442dc58dd3b4648c90a733500a09","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wombat/quickbooks_integration/pulls/5/commits","review_comments_url":"https://api.github.com/repos/wombat/quickbooks_integration/pulls/5/comments","review_comment_url":"https://api.github.com/repos/wombat/quickbooks_integration/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wombat/quickbooks_integration/issues/5/comments","statuses_url":"https://api.github.com/repos/wombat/quickbooks_integration/statuses/3a46dc30f2193cbfa5c8e903f6d4e3c3935497dd","head":{"label":"pervino:master","ref":"master","sha":"3a46dc30f2193cbfa5c8e903f6d4e3c3935497dd","user":{"login":"pervino","id":12450484,"avatar_url":"https://avatars.githubusercontent.com/u/12450484?v=3","gravatar_id":"","url":"https://api.github.com/users/pervino","html_url":"https://github.com/pervino","followers_url":"https://api.github.com/users/pervino/followers","following_url":"https://api.github.com/users/pervino/following{/other_user}","gists_url":"https://api.github.com/users/pervino/gists{/gist_id}","starred_url":"https://api.github.com/users/pervino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pervino/subscriptions","organizations_url":"https://api.github.com/users/pervino/orgs","repos_url":"https://api.github.com/users/pervino/repos","events_url":"https://api.github.com/users/pervino/events{/privacy}","received_events_url":"https://api.github.com/users/pervino/received_events","type":"Organization","site_admin":false},"repo":{"id":42138652,"name":"quickbooks_integration","full_name":"pervino/quickbooks_integration","owner":{"login":"pervino","id":12450484,"avatar_url":"https://avatars.githubusercontent.com/u/12450484?v=3","gravatar_id":"","url":"https://api.github.com/users/pervino","html_url":"https://github.com/pervino","followers_url":"https://api.github.com/users/pervino/followers","following_url":"https://api.github.com/users/pervino/following{/other_user}","gists_url":"https://api.github.com/users/pervino/gists{/gist_id}","starred_url":"https://api.github.com/users/pervino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pervino/subscriptions","organizations_url":"https://api.github.com/users/pervino/orgs","repos_url":"https://api.github.com/users/pervino/repos","events_url":"https://api.github.com/users/pervino/events{/privacy}","received_events_url":"https://api.github.com/users/pervino/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pervino/quickbooks_integration","description":"Integrates Quickbooks with any storefront.","fork":true,"url":"https://api.github.com/repos/pervino/quickbooks_integration","forks_url":"https://api.github.com/repos/pervino/quickbooks_integration/forks","keys_url":"https://api.github.com/repos/pervino/quickbooks_integration/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pervino/quickbooks_integration/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pervino/quickbooks_integration/teams","hooks_url":"https://api.github.com/repos/pervino/quickbooks_integration/hooks","issue_events_url":"https://api.github.com/repos/pervino/quickbooks_integration/issues/events{/number}","events_url":"https://api.github.com/repos/pervino/quickbooks_integration/events","assignees_url":"https://api.github.com/repos/pervino/quickbooks_integration/assignees{/user}","branches_url":"https://api.github.com/repos/pervino/quickbooks_integration/branches{/branch}","tags_url":"https://api.github.com/repos/pervino/quickbooks_integration/tags","blobs_url":"https://api.github.com/repos/pervino/quickbooks_integration/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pervino/quickbooks_integration/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pervino/quickbooks_integration/git/refs{/sha}","trees_url":"https://api.github.com/repos/pervino/quickbooks_integration/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pervino/quickbooks_integration/statuses/{sha}","languages_url":"https://api.github.com/repos/pervino/quickbooks_integration/languages","stargazers_url":"https://api.github.com/repos/pervino/quickbooks_integration/stargazers","contributors_url":"https://api.github.com/repos/pervino/quickbooks_integration/contributors","subscribers_url":"https://api.github.com/repos/pervino/quickbooks_integration/subscribers","subscription_url":"https://api.github.com/repos/pervino/quickbooks_integration/subscription","commits_url":"https://api.github.com/repos/pervino/quickbooks_integration/commits{/sha}","git_commits_url":"https://api.github.com/repos/pervino/quickbooks_integration/git/commits{/sha}","comments_url":"https://api.github.com/repos/pervino/quickbooks_integration/comments{/number}","issue_comment_url":"https://api.github.com/repos/pervino/quickbooks_integration/issues/comments{/number}","contents_url":"https://api.github.com/repos/pervino/quickbooks_integration/contents/{+path}","compare_url":"https://api.github.com/repos/pervino/quickbooks_integration/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pervino/quickbooks_integration/merges","archive_url":"https://api.github.com/repos/pervino/quickbooks_integration/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pervino/quickbooks_integration/downloads","issues_url":"https://api.github.com/repos/pervino/quickbooks_integration/issues{/number}","pulls_url":"https://api.github.com/repos/pervino/quickbooks_integration/pulls{/number}","milestones_url":"https://api.github.com/repos/pervino/quickbooks_integration/milestones{/number}","notifications_url":"https://api.github.com/repos/pervino/quickbooks_integration/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pervino/quickbooks_integration/labels{/name}","releases_url":"https://api.github.com/repos/pervino/quickbooks_integration/releases{/id}","created_at":"2015-09-08T20:57:35Z","updated_at":"2015-09-08T20:57:36Z","pushed_at":"2015-09-08T20:58:03Z","git_url":"git://github.com/pervino/quickbooks_integration.git","ssh_url":"git@github.com:pervino/quickbooks_integration.git","clone_url":"https://github.com/pervino/quickbooks_integration.git","svn_url":"https://github.com/pervino/quickbooks_integration","homepage":"http://wombat.co","size":1304,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"wombat:master","ref":"master","sha":"c28ae725b6b441725153f28434aba15d9ec0969c","user":{"login":"wombat","id":10879,"avatar_url":"https://avatars.githubusercontent.com/u/10879?v=3","gravatar_id":"","url":"https://api.github.com/users/wombat","html_url":"https://github.com/wombat","followers_url":"https://api.github.com/users/wombat/followers","following_url":"https://api.github.com/users/wombat/following{/other_user}","gists_url":"https://api.github.com/users/wombat/gists{/gist_id}","starred_url":"https://api.github.com/users/wombat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wombat/subscriptions","organizations_url":"https://api.github.com/users/wombat/orgs","repos_url":"https://api.github.com/users/wombat/repos","events_url":"https://api.github.com/users/wombat/events{/privacy}","received_events_url":"https://api.github.com/users/wombat/received_events","type":"Organization","site_admin":false},"repo":{"id":20259688,"name":"quickbooks_integration","full_name":"wombat/quickbooks_integration","owner":{"login":"wombat","id":10879,"avatar_url":"https://avatars.githubusercontent.com/u/10879?v=3","gravatar_id":"","url":"https://api.github.com/users/wombat","html_url":"https://github.com/wombat","followers_url":"https://api.github.com/users/wombat/followers","following_url":"https://api.github.com/users/wombat/following{/other_user}","gists_url":"https://api.github.com/users/wombat/gists{/gist_id}","starred_url":"https://api.github.com/users/wombat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wombat/subscriptions","organizations_url":"https://api.github.com/users/wombat/orgs","repos_url":"https://api.github.com/users/wombat/repos","events_url":"https://api.github.com/users/wombat/events{/privacy}","received_events_url":"https://api.github.com/users/wombat/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wombat/quickbooks_integration","description":"Integrates Quickbooks with any storefront.","fork":false,"url":"https://api.github.com/repos/wombat/quickbooks_integration","forks_url":"https://api.github.com/repos/wombat/quickbooks_integration/forks","keys_url":"https://api.github.com/repos/wombat/quickbooks_integration/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wombat/quickbooks_integration/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wombat/quickbooks_integration/teams","hooks_url":"https://api.github.com/repos/wombat/quickbooks_integration/hooks","issue_events_url":"https://api.github.com/repos/wombat/quickbooks_integration/issues/events{/number}","events_url":"https://api.github.com/repos/wombat/quickbooks_integration/events","assignees_url":"https://api.github.com/repos/wombat/quickbooks_integration/assignees{/user}","branches_url":"https://api.github.com/repos/wombat/quickbooks_integration/branches{/branch}","tags_url":"https://api.github.com/repos/wombat/quickbooks_integration/tags","blobs_url":"https://api.github.com/repos/wombat/quickbooks_integration/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wombat/quickbooks_integration/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wombat/quickbooks_integration/git/refs{/sha}","trees_url":"https://api.github.com/repos/wombat/quickbooks_integration/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wombat/quickbooks_integration/statuses/{sha}","languages_url":"https://api.github.com/repos/wombat/quickbooks_integration/languages","stargazers_url":"https://api.github.com/repos/wombat/quickbooks_integration/stargazers","contributors_url":"https://api.github.com/repos/wombat/quickbooks_integration/contributors","subscribers_url":"https://api.github.com/repos/wombat/quickbooks_integration/subscribers","subscription_url":"https://api.github.com/repos/wombat/quickbooks_integration/subscription","commits_url":"https://api.github.com/repos/wombat/quickbooks_integration/commits{/sha}","git_commits_url":"https://api.github.com/repos/wombat/quickbooks_integration/git/commits{/sha}","comments_url":"https://api.github.com/repos/wombat/quickbooks_integration/comments{/number}","issue_comment_url":"https://api.github.com/repos/wombat/quickbooks_integration/issues/comments{/number}","contents_url":"https://api.github.com/repos/wombat/quickbooks_integration/contents/{+path}","compare_url":"https://api.github.com/repos/wombat/quickbooks_integration/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wombat/quickbooks_integration/merges","archive_url":"https://api.github.com/repos/wombat/quickbooks_integration/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wombat/quickbooks_integration/downloads","issues_url":"https://api.github.com/repos/wombat/quickbooks_integration/issues{/number}","pulls_url":"https://api.github.com/repos/wombat/quickbooks_integration/pulls{/number}","milestones_url":"https://api.github.com/repos/wombat/quickbooks_integration/milestones{/number}","notifications_url":"https://api.github.com/repos/wombat/quickbooks_integration/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wombat/quickbooks_integration/labels{/name}","releases_url":"https://api.github.com/repos/wombat/quickbooks_integration/releases{/id}","created_at":"2014-05-28T14:06:52Z","updated_at":"2015-08-13T06:22:34Z","pushed_at":"2015-09-08T20:59:52Z","git_url":"git://github.com/wombat/quickbooks_integration.git","ssh_url":"git@github.com:wombat/quickbooks_integration.git","clone_url":"https://github.com/wombat/quickbooks_integration.git","svn_url":"https://github.com/wombat/quickbooks_integration","homepage":"http://wombat.co","size":1304,"stargazers_count":5,"watchers_count":5,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":3,"forks":5,"open_issues":3,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wombat/quickbooks_integration/pulls/5"},"html":{"href":"https://github.com/wombat/quickbooks_integration/pull/5"},"issue":{"href":"https://api.github.com/repos/wombat/quickbooks_integration/issues/5"},"comments":{"href":"https://api.github.com/repos/wombat/quickbooks_integration/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/wombat/quickbooks_integration/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/wombat/quickbooks_integration/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wombat/quickbooks_integration/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/wombat/quickbooks_integration/statuses/3a46dc30f2193cbfa5c8e903f6d4e3c3935497dd"}}}}