{"action":"created","comment":{"url":"https://api.github.com/repos/applegrain/sales_engine/pulls/comments/33082150","id":33082150,"diff_hunk":"@@ -29,16 +29,34 @@ def invoices\n   end\n \n   def revenue(date = nil)\n-    filtered = filter_transactions(date)\n-    invoice_items = get_invoice_id_from_filtered_transactions(filtered)\n+    filtered = filter_transactions(date, 'success')\n+    invoice_ids = get_invoice_id_from_filtered_transactions(filtered)\n+    invoice_items = get_invoice_items_from_invoice_ids(invoice_ids)\n     calculate_revenue(invoice_items)\n   end\n \n-  def filter_transactions(date)\n+  def favorite_customer\n+    transactions = filter_transactions('success')","path":"lib/merchant.rb","position":14,"original_position":14,"commit_id":"c4c951d8d6fedefbb2f5fa27871ecaa25557718f","original_commit_id":"c4c951d8d6fedefbb2f5fa27871ecaa25557718f","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.","created_at":"2015-06-23T19:36:32Z","updated_at":"2015-06-23T19:36:32Z","html_url":"https://github.com/applegrain/sales_engine/pull/20#discussion_r33082150","pull_request_url":"https://api.github.com/repos/applegrain/sales_engine/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/applegrain/sales_engine/pulls/comments/33082150"},"html":{"href":"https://github.com/applegrain/sales_engine/pull/20#discussion_r33082150"},"pull_request":{"href":"https://api.github.com/repos/applegrain/sales_engine/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/applegrain/sales_engine/pulls/20","id":38346856,"html_url":"https://github.com/applegrain/sales_engine/pull/20","diff_url":"https://github.com/applegrain/sales_engine/pull/20.diff","patch_url":"https://github.com/applegrain/sales_engine/pull/20.patch","issue_url":"https://api.github.com/repos/applegrain/sales_engine/issues/20","number":20,"state":"open","locked":false,"title":"Merchant bi","user":{"login":"applegrain","id":10555255,"avatar_url":"https://avatars.githubusercontent.com/u/10555255?v=3","gravatar_id":"","url":"https://api.github.com/users/applegrain","html_url":"https://github.com/applegrain","followers_url":"https://api.github.com/users/applegrain/followers","following_url":"https://api.github.com/users/applegrain/following{/other_user}","gists_url":"https://api.github.com/users/applegrain/gists{/gist_id}","starred_url":"https://api.github.com/users/applegrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/applegrain/subscriptions","organizations_url":"https://api.github.com/users/applegrain/orgs","repos_url":"https://api.github.com/users/applegrain/repos","events_url":"https://api.github.com/users/applegrain/events{/privacy}","received_events_url":"https://api.github.com/users/applegrain/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-23T15:05:45Z","updated_at":"2015-06-23T19:36:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4587b5ab79d38a874dd6b4ccc9a271f60d1940d3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/applegrain/sales_engine/pulls/20/commits","review_comments_url":"https://api.github.com/repos/applegrain/sales_engine/pulls/20/comments","review_comment_url":"https://api.github.com/repos/applegrain/sales_engine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/applegrain/sales_engine/issues/20/comments","statuses_url":"https://api.github.com/repos/applegrain/sales_engine/statuses/c4c951d8d6fedefbb2f5fa27871ecaa25557718f","head":{"label":"applegrain:merchant-BI","ref":"merchant-BI","sha":"c4c951d8d6fedefbb2f5fa27871ecaa25557718f","user":{"login":"applegrain","id":10555255,"avatar_url":"https://avatars.githubusercontent.com/u/10555255?v=3","gravatar_id":"","url":"https://api.github.com/users/applegrain","html_url":"https://github.com/applegrain","followers_url":"https://api.github.com/users/applegrain/followers","following_url":"https://api.github.com/users/applegrain/following{/other_user}","gists_url":"https://api.github.com/users/applegrain/gists{/gist_id}","starred_url":"https://api.github.com/users/applegrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/applegrain/subscriptions","organizations_url":"https://api.github.com/users/applegrain/orgs","repos_url":"https://api.github.com/users/applegrain/repos","events_url":"https://api.github.com/users/applegrain/events{/privacy}","received_events_url":"https://api.github.com/users/applegrain/received_events","type":"User","site_admin":false},"repo":{"id":37485947,"name":"sales_engine","full_name":"applegrain/sales_engine","owner":{"login":"applegrain","id":10555255,"avatar_url":"https://avatars.githubusercontent.com/u/10555255?v=3","gravatar_id":"","url":"https://api.github.com/users/applegrain","html_url":"https://github.com/applegrain","followers_url":"https://api.github.com/users/applegrain/followers","following_url":"https://api.github.com/users/applegrain/following{/other_user}","gists_url":"https://api.github.com/users/applegrain/gists{/gist_id}","starred_url":"https://api.github.com/users/applegrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/applegrain/subscriptions","organizations_url":"https://api.github.com/users/applegrain/orgs","repos_url":"https://api.github.com/users/applegrain/repos","events_url":"https://api.github.com/users/applegrain/events{/privacy}","received_events_url":"https://api.github.com/users/applegrain/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/applegrain/sales_engine","description":null,"fork":false,"url":"https://api.github.com/repos/applegrain/sales_engine","forks_url":"https://api.github.com/repos/applegrain/sales_engine/forks","keys_url":"https://api.github.com/repos/applegrain/sales_engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/applegrain/sales_engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/applegrain/sales_engine/teams","hooks_url":"https://api.github.com/repos/applegrain/sales_engine/hooks","issue_events_url":"https://api.github.com/repos/applegrain/sales_engine/issues/events{/number}","events_url":"https://api.github.com/repos/applegrain/sales_engine/events","assignees_url":"https://api.github.com/repos/applegrain/sales_engine/assignees{/user}","branches_url":"https://api.github.com/repos/applegrain/sales_engine/branches{/branch}","tags_url":"https://api.github.com/repos/applegrain/sales_engine/tags","blobs_url":"https://api.github.com/repos/applegrain/sales_engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/applegrain/sales_engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/applegrain/sales_engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/applegrain/sales_engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/applegrain/sales_engine/statuses/{sha}","languages_url":"https://api.github.com/repos/applegrain/sales_engine/languages","stargazers_url":"https://api.github.com/repos/applegrain/sales_engine/stargazers","contributors_url":"https://api.github.com/repos/applegrain/sales_engine/contributors","subscribers_url":"https://api.github.com/repos/applegrain/sales_engine/subscribers","subscription_url":"https://api.github.com/repos/applegrain/sales_engine/subscription","commits_url":"https://api.github.com/repos/applegrain/sales_engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/applegrain/sales_engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/applegrain/sales_engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/applegrain/sales_engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/applegrain/sales_engine/contents/{+path}","compare_url":"https://api.github.com/repos/applegrain/sales_engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/applegrain/sales_engine/merges","archive_url":"https://api.github.com/repos/applegrain/sales_engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/applegrain/sales_engine/downloads","issues_url":"https://api.github.com/repos/applegrain/sales_engine/issues{/number}","pulls_url":"https://api.github.com/repos/applegrain/sales_engine/pulls{/number}","milestones_url":"https://api.github.com/repos/applegrain/sales_engine/milestones{/number}","notifications_url":"https://api.github.com/repos/applegrain/sales_engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/applegrain/sales_engine/labels{/name}","releases_url":"https://api.github.com/repos/applegrain/sales_engine/releases{/id}","created_at":"2015-06-15T19:17:37Z","updated_at":"2015-06-15T19:17:58Z","pushed_at":"2015-06-23T19:36:26Z","git_url":"git://github.com/applegrain/sales_engine.git","ssh_url":"git@github.com:applegrain/sales_engine.git","clone_url":"https://github.com/applegrain/sales_engine.git","svn_url":"https://github.com/applegrain/sales_engine","homepage":null,"size":889,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"applegrain:master","ref":"master","sha":"455ccab2a2ce6493a89b9a7bd0c96879a16366a4","user":{"login":"applegrain","id":10555255,"avatar_url":"https://avatars.githubusercontent.com/u/10555255?v=3","gravatar_id":"","url":"https://api.github.com/users/applegrain","html_url":"https://github.com/applegrain","followers_url":"https://api.github.com/users/applegrain/followers","following_url":"https://api.github.com/users/applegrain/following{/other_user}","gists_url":"https://api.github.com/users/applegrain/gists{/gist_id}","starred_url":"https://api.github.com/users/applegrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/applegrain/subscriptions","organizations_url":"https://api.github.com/users/applegrain/orgs","repos_url":"https://api.github.com/users/applegrain/repos","events_url":"https://api.github.com/users/applegrain/events{/privacy}","received_events_url":"https://api.github.com/users/applegrain/received_events","type":"User","site_admin":false},"repo":{"id":37485947,"name":"sales_engine","full_name":"applegrain/sales_engine","owner":{"login":"applegrain","id":10555255,"avatar_url":"https://avatars.githubusercontent.com/u/10555255?v=3","gravatar_id":"","url":"https://api.github.com/users/applegrain","html_url":"https://github.com/applegrain","followers_url":"https://api.github.com/users/applegrain/followers","following_url":"https://api.github.com/users/applegrain/following{/other_user}","gists_url":"https://api.github.com/users/applegrain/gists{/gist_id}","starred_url":"https://api.github.com/users/applegrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/applegrain/subscriptions","organizations_url":"https://api.github.com/users/applegrain/orgs","repos_url":"https://api.github.com/users/applegrain/repos","events_url":"https://api.github.com/users/applegrain/events{/privacy}","received_events_url":"https://api.github.com/users/applegrain/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/applegrain/sales_engine","description":null,"fork":false,"url":"https://api.github.com/repos/applegrain/sales_engine","forks_url":"https://api.github.com/repos/applegrain/sales_engine/forks","keys_url":"https://api.github.com/repos/applegrain/sales_engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/applegrain/sales_engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/applegrain/sales_engine/teams","hooks_url":"https://api.github.com/repos/applegrain/sales_engine/hooks","issue_events_url":"https://api.github.com/repos/applegrain/sales_engine/issues/events{/number}","events_url":"https://api.github.com/repos/applegrain/sales_engine/events","assignees_url":"https://api.github.com/repos/applegrain/sales_engine/assignees{/user}","branches_url":"https://api.github.com/repos/applegrain/sales_engine/branches{/branch}","tags_url":"https://api.github.com/repos/applegrain/sales_engine/tags","blobs_url":"https://api.github.com/repos/applegrain/sales_engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/applegrain/sales_engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/applegrain/sales_engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/applegrain/sales_engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/applegrain/sales_engine/statuses/{sha}","languages_url":"https://api.github.com/repos/applegrain/sales_engine/languages","stargazers_url":"https://api.github.com/repos/applegrain/sales_engine/stargazers","contributors_url":"https://api.github.com/repos/applegrain/sales_engine/contributors","subscribers_url":"https://api.github.com/repos/applegrain/sales_engine/subscribers","subscription_url":"https://api.github.com/repos/applegrain/sales_engine/subscription","commits_url":"https://api.github.com/repos/applegrain/sales_engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/applegrain/sales_engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/applegrain/sales_engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/applegrain/sales_engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/applegrain/sales_engine/contents/{+path}","compare_url":"https://api.github.com/repos/applegrain/sales_engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/applegrain/sales_engine/merges","archive_url":"https://api.github.com/repos/applegrain/sales_engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/applegrain/sales_engine/downloads","issues_url":"https://api.github.com/repos/applegrain/sales_engine/issues{/number}","pulls_url":"https://api.github.com/repos/applegrain/sales_engine/pulls{/number}","milestones_url":"https://api.github.com/repos/applegrain/sales_engine/milestones{/number}","notifications_url":"https://api.github.com/repos/applegrain/sales_engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/applegrain/sales_engine/labels{/name}","releases_url":"https://api.github.com/repos/applegrain/sales_engine/releases{/id}","created_at":"2015-06-15T19:17:37Z","updated_at":"2015-06-15T19:17:58Z","pushed_at":"2015-06-23T19:36:26Z","git_url":"git://github.com/applegrain/sales_engine.git","ssh_url":"git@github.com:applegrain/sales_engine.git","clone_url":"https://github.com/applegrain/sales_engine.git","svn_url":"https://github.com/applegrain/sales_engine","homepage":null,"size":889,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/applegrain/sales_engine/pulls/20"},"html":{"href":"https://github.com/applegrain/sales_engine/pull/20"},"issue":{"href":"https://api.github.com/repos/applegrain/sales_engine/issues/20"},"comments":{"href":"https://api.github.com/repos/applegrain/sales_engine/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/applegrain/sales_engine/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/applegrain/sales_engine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/applegrain/sales_engine/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/applegrain/sales_engine/statuses/c4c951d8d6fedefbb2f5fa27871ecaa25557718f"}}}}