{"action":"created","comment":{"url":"https://api.github.com/repos/pwentz/rails_engine/pulls/comments/77562078","id":77562078,"diff_hunk":"@@ -6,4 +6,42 @@\n     it { should have_many(:invoices) }\n     it { should have_many(:customers).through(:invoices) }\n   end\n+\n+  it 'returns the top ranked x merchants by total items sold' do\n+    merchant_one,\n+    merchant_two,\n+    merchant_three = create_list(:merchant, 3)\n+\n+    invoice_one = create(:invoice, merchant: merchant_one)\n+    invoice_two = create(:invoice, merchant: merchant_two)\n+    invoice_three = create(:invoice, merchant: merchant_three)\n+\n+    item_one = create(:item, merchant: merchant_one)\n+    item_two = create(:item, merchant: merchant_two)\n+    item_three = create(:item, merchant: merchant_three)\n+\n+    invoice_item_one = create(\n+      :invoice_item,\n+      quantity: 7,\n+      item: item_one,\n+      invoice: invoice_one\n+    )\n+    invoice_item_two = create(\n+      :invoice_item,\n+      quantity: 2,\n+      item: item_two,\n+      invoice: invoice_two\n+    )\n+    invoice_item_three = create(","path":"spec/models/merchant_spec.rb","position":30,"original_position":30,"commit_id":"1e879460d74218684f7203bdb30db008eaaa375a","original_commit_id":"1e879460d74218684f7203bdb30db008eaaa375a","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Useless assignment to variable - invoice_item_three.","created_at":"2016-09-06T01:12:28Z","updated_at":"2016-09-06T01:12:28Z","html_url":"https://github.com/pwentz/rails_engine/pull/30#discussion_r77562078","pull_request_url":"https://api.github.com/repos/pwentz/rails_engine/pulls/30","_links":{"self":{"href":"https://api.github.com/repos/pwentz/rails_engine/pulls/comments/77562078"},"html":{"href":"https://github.com/pwentz/rails_engine/pull/30#discussion_r77562078"},"pull_request":{"href":"https://api.github.com/repos/pwentz/rails_engine/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/pwentz/rails_engine/pulls/30","id":84048344,"html_url":"https://github.com/pwentz/rails_engine/pull/30","diff_url":"https://github.com/pwentz/rails_engine/pull/30.diff","patch_url":"https://github.com/pwentz/rails_engine/pull/30.patch","issue_url":"https://api.github.com/repos/pwentz/rails_engine/issues/30","number":30,"state":"open","locked":false,"title":"close #29 top x merchants by most items sold query method","user":{"login":"pwentz","id":18466392,"avatar_url":"https://avatars.githubusercontent.com/u/18466392?v=3","gravatar_id":"","url":"https://api.github.com/users/pwentz","html_url":"https://github.com/pwentz","followers_url":"https://api.github.com/users/pwentz/followers","following_url":"https://api.github.com/users/pwentz/following{/other_user}","gists_url":"https://api.github.com/users/pwentz/gists{/gist_id}","starred_url":"https://api.github.com/users/pwentz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwentz/subscriptions","organizations_url":"https://api.github.com/users/pwentz/orgs","repos_url":"https://api.github.com/users/pwentz/repos","events_url":"https://api.github.com/users/pwentz/events{/privacy}","received_events_url":"https://api.github.com/users/pwentz/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-06T01:08:42Z","updated_at":"2016-09-06T01:12:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e6ef73a60b797a1448b0e51e7baea6d08de85f9a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pwentz/rails_engine/pulls/30/commits","review_comments_url":"https://api.github.com/repos/pwentz/rails_engine/pulls/30/comments","review_comment_url":"https://api.github.com/repos/pwentz/rails_engine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pwentz/rails_engine/issues/30/comments","statuses_url":"https://api.github.com/repos/pwentz/rails_engine/statuses/1e879460d74218684f7203bdb30db008eaaa375a","head":{"label":"pwentz:29_all_merchants_most_items_sold","ref":"29_all_merchants_most_items_sold","sha":"1e879460d74218684f7203bdb30db008eaaa375a","user":{"login":"pwentz","id":18466392,"avatar_url":"https://avatars.githubusercontent.com/u/18466392?v=3","gravatar_id":"","url":"https://api.github.com/users/pwentz","html_url":"https://github.com/pwentz","followers_url":"https://api.github.com/users/pwentz/followers","following_url":"https://api.github.com/users/pwentz/following{/other_user}","gists_url":"https://api.github.com/users/pwentz/gists{/gist_id}","starred_url":"https://api.github.com/users/pwentz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwentz/subscriptions","organizations_url":"https://api.github.com/users/pwentz/orgs","repos_url":"https://api.github.com/users/pwentz/repos","events_url":"https://api.github.com/users/pwentz/events{/privacy}","received_events_url":"https://api.github.com/users/pwentz/received_events","type":"User","site_admin":false},"repo":{"id":67433339,"name":"rails_engine","full_name":"pwentz/rails_engine","owner":{"login":"pwentz","id":18466392,"avatar_url":"https://avatars.githubusercontent.com/u/18466392?v=3","gravatar_id":"","url":"https://api.github.com/users/pwentz","html_url":"https://github.com/pwentz","followers_url":"https://api.github.com/users/pwentz/followers","following_url":"https://api.github.com/users/pwentz/following{/other_user}","gists_url":"https://api.github.com/users/pwentz/gists{/gist_id}","starred_url":"https://api.github.com/users/pwentz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwentz/subscriptions","organizations_url":"https://api.github.com/users/pwentz/orgs","repos_url":"https://api.github.com/users/pwentz/repos","events_url":"https://api.github.com/users/pwentz/events{/privacy}","received_events_url":"https://api.github.com/users/pwentz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pwentz/rails_engine","description":"Turing - Mod 3 (Week 4) Pair project","fork":false,"url":"https://api.github.com/repos/pwentz/rails_engine","forks_url":"https://api.github.com/repos/pwentz/rails_engine/forks","keys_url":"https://api.github.com/repos/pwentz/rails_engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pwentz/rails_engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pwentz/rails_engine/teams","hooks_url":"https://api.github.com/repos/pwentz/rails_engine/hooks","issue_events_url":"https://api.github.com/repos/pwentz/rails_engine/issues/events{/number}","events_url":"https://api.github.com/repos/pwentz/rails_engine/events","assignees_url":"https://api.github.com/repos/pwentz/rails_engine/assignees{/user}","branches_url":"https://api.github.com/repos/pwentz/rails_engine/branches{/branch}","tags_url":"https://api.github.com/repos/pwentz/rails_engine/tags","blobs_url":"https://api.github.com/repos/pwentz/rails_engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pwentz/rails_engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pwentz/rails_engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/pwentz/rails_engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pwentz/rails_engine/statuses/{sha}","languages_url":"https://api.github.com/repos/pwentz/rails_engine/languages","stargazers_url":"https://api.github.com/repos/pwentz/rails_engine/stargazers","contributors_url":"https://api.github.com/repos/pwentz/rails_engine/contributors","subscribers_url":"https://api.github.com/repos/pwentz/rails_engine/subscribers","subscription_url":"https://api.github.com/repos/pwentz/rails_engine/subscription","commits_url":"https://api.github.com/repos/pwentz/rails_engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/pwentz/rails_engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/pwentz/rails_engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/pwentz/rails_engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/pwentz/rails_engine/contents/{+path}","compare_url":"https://api.github.com/repos/pwentz/rails_engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pwentz/rails_engine/merges","archive_url":"https://api.github.com/repos/pwentz/rails_engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pwentz/rails_engine/downloads","issues_url":"https://api.github.com/repos/pwentz/rails_engine/issues{/number}","pulls_url":"https://api.github.com/repos/pwentz/rails_engine/pulls{/number}","milestones_url":"https://api.github.com/repos/pwentz/rails_engine/milestones{/number}","notifications_url":"https://api.github.com/repos/pwentz/rails_engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pwentz/rails_engine/labels{/name}","releases_url":"https://api.github.com/repos/pwentz/rails_engine/releases{/id}","deployments_url":"https://api.github.com/repos/pwentz/rails_engine/deployments","created_at":"2016-09-05T15:49:34Z","updated_at":"2016-09-05T17:37:17Z","pushed_at":"2016-09-06T01:12:18Z","git_url":"git://github.com/pwentz/rails_engine.git","ssh_url":"git@github.com:pwentz/rails_engine.git","clone_url":"https://github.com/pwentz/rails_engine.git","svn_url":"https://github.com/pwentz/rails_engine","homepage":"https://github.com/turingschool/lesson_plans/blob/master/ruby_03-professional_rails_applications/rails_engine.md","size":36,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":24,"forks":0,"open_issues":24,"watchers":0,"default_branch":"develop"}},"base":{"label":"pwentz:develop","ref":"develop","sha":"ff7db7aad332e8cda50767e0690e800088f044a5","user":{"login":"pwentz","id":18466392,"avatar_url":"https://avatars.githubusercontent.com/u/18466392?v=3","gravatar_id":"","url":"https://api.github.com/users/pwentz","html_url":"https://github.com/pwentz","followers_url":"https://api.github.com/users/pwentz/followers","following_url":"https://api.github.com/users/pwentz/following{/other_user}","gists_url":"https://api.github.com/users/pwentz/gists{/gist_id}","starred_url":"https://api.github.com/users/pwentz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwentz/subscriptions","organizations_url":"https://api.github.com/users/pwentz/orgs","repos_url":"https://api.github.com/users/pwentz/repos","events_url":"https://api.github.com/users/pwentz/events{/privacy}","received_events_url":"https://api.github.com/users/pwentz/received_events","type":"User","site_admin":false},"repo":{"id":67433339,"name":"rails_engine","full_name":"pwentz/rails_engine","owner":{"login":"pwentz","id":18466392,"avatar_url":"https://avatars.githubusercontent.com/u/18466392?v=3","gravatar_id":"","url":"https://api.github.com/users/pwentz","html_url":"https://github.com/pwentz","followers_url":"https://api.github.com/users/pwentz/followers","following_url":"https://api.github.com/users/pwentz/following{/other_user}","gists_url":"https://api.github.com/users/pwentz/gists{/gist_id}","starred_url":"https://api.github.com/users/pwentz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwentz/subscriptions","organizations_url":"https://api.github.com/users/pwentz/orgs","repos_url":"https://api.github.com/users/pwentz/repos","events_url":"https://api.github.com/users/pwentz/events{/privacy}","received_events_url":"https://api.github.com/users/pwentz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pwentz/rails_engine","description":"Turing - Mod 3 (Week 4) Pair project","fork":false,"url":"https://api.github.com/repos/pwentz/rails_engine","forks_url":"https://api.github.com/repos/pwentz/rails_engine/forks","keys_url":"https://api.github.com/repos/pwentz/rails_engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pwentz/rails_engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pwentz/rails_engine/teams","hooks_url":"https://api.github.com/repos/pwentz/rails_engine/hooks","issue_events_url":"https://api.github.com/repos/pwentz/rails_engine/issues/events{/number}","events_url":"https://api.github.com/repos/pwentz/rails_engine/events","assignees_url":"https://api.github.com/repos/pwentz/rails_engine/assignees{/user}","branches_url":"https://api.github.com/repos/pwentz/rails_engine/branches{/branch}","tags_url":"https://api.github.com/repos/pwentz/rails_engine/tags","blobs_url":"https://api.github.com/repos/pwentz/rails_engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pwentz/rails_engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pwentz/rails_engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/pwentz/rails_engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pwentz/rails_engine/statuses/{sha}","languages_url":"https://api.github.com/repos/pwentz/rails_engine/languages","stargazers_url":"https://api.github.com/repos/pwentz/rails_engine/stargazers","contributors_url":"https://api.github.com/repos/pwentz/rails_engine/contributors","subscribers_url":"https://api.github.com/repos/pwentz/rails_engine/subscribers","subscription_url":"https://api.github.com/repos/pwentz/rails_engine/subscription","commits_url":"https://api.github.com/repos/pwentz/rails_engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/pwentz/rails_engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/pwentz/rails_engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/pwentz/rails_engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/pwentz/rails_engine/contents/{+path}","compare_url":"https://api.github.com/repos/pwentz/rails_engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pwentz/rails_engine/merges","archive_url":"https://api.github.com/repos/pwentz/rails_engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pwentz/rails_engine/downloads","issues_url":"https://api.github.com/repos/pwentz/rails_engine/issues{/number}","pulls_url":"https://api.github.com/repos/pwentz/rails_engine/pulls{/number}","milestones_url":"https://api.github.com/repos/pwentz/rails_engine/milestones{/number}","notifications_url":"https://api.github.com/repos/pwentz/rails_engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pwentz/rails_engine/labels{/name}","releases_url":"https://api.github.com/repos/pwentz/rails_engine/releases{/id}","deployments_url":"https://api.github.com/repos/pwentz/rails_engine/deployments","created_at":"2016-09-05T15:49:34Z","updated_at":"2016-09-05T17:37:17Z","pushed_at":"2016-09-06T01:12:18Z","git_url":"git://github.com/pwentz/rails_engine.git","ssh_url":"git@github.com:pwentz/rails_engine.git","clone_url":"https://github.com/pwentz/rails_engine.git","svn_url":"https://github.com/pwentz/rails_engine","homepage":"https://github.com/turingschool/lesson_plans/blob/master/ruby_03-professional_rails_applications/rails_engine.md","size":36,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":24,"forks":0,"open_issues":24,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/pwentz/rails_engine/pulls/30"},"html":{"href":"https://github.com/pwentz/rails_engine/pull/30"},"issue":{"href":"https://api.github.com/repos/pwentz/rails_engine/issues/30"},"comments":{"href":"https://api.github.com/repos/pwentz/rails_engine/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/pwentz/rails_engine/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/pwentz/rails_engine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pwentz/rails_engine/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/pwentz/rails_engine/statuses/1e879460d74218684f7203bdb30db008eaaa375a"}}}}
{"actor":{"display_login":"houndci-bot"}}