{"action":"created","comment":{"url":"https://api.github.com/repos/TechLadies/highpoint/pulls/comments/87145747","pull_request_review_id":7768663,"id":87145747,"diff_hunk":"@@ -1,10 +1,23 @@\n .card.card-inverse.card-info.text-xs-center\n-  .card.card-inverse.card-info.text-xs-center\n-    .card-block\n-      h1 Total Donations for #{Date.today.year}\n-      h1 $#{@donations.donations_per_year(Date.current.year).sum(:amount).round}\n+  .card-block\n+    h1 Total Donations for #{Date.today.year}\n+    h1 $#{@donations.donations_per_year(Date.current.year).sum(:amount).round}\n = area_chart @donations.includes(:cause).where(\"donations.created_at BETWEEN ? AND ?\", Date.current.beginning_of_year, Date.current.end_of_year).group(\"causes.name\").group_by_week(\"donations.created_at\").sum(:amount)\n \n+.row.margin-top\n+  - @causes.each do |cause|\n+    .col-xs-6.col-md-3\n+      .card.card-outline-primary.text-xs-center\n+        .card-header = cause.name\n+        .card-block\n+          h4.card-title Top Donor:\n+          - top_donation = cause.donations.where(\"donations.created_at BETWEEN ? AND ?\", Date.current.beginning_of_year, Date.current.end_of_year).order(\"amount DESC\").first","path":"app/views/donations/index.html.slim","position":null,"original_position":18,"commit_id":"07d261b3fb31dbb5ba038d29a5b6f8d9bb17f50a","original_commit_id":"3be6ada679d5bfb36bccef1e0fdf901441253617","user":{"login":"alahab2","id":19661205,"avatar_url":"https://avatars.githubusercontent.com/u/19661205?v=3","gravatar_id":"","url":"https://api.github.com/users/alahab2","html_url":"https://github.com/alahab2","followers_url":"https://api.github.com/users/alahab2/followers","following_url":"https://api.github.com/users/alahab2/following{/other_user}","gists_url":"https://api.github.com/users/alahab2/gists{/gist_id}","starred_url":"https://api.github.com/users/alahab2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alahab2/subscriptions","organizations_url":"https://api.github.com/users/alahab2/orgs","repos_url":"https://api.github.com/users/alahab2/repos","events_url":"https://api.github.com/users/alahab2/events{/privacy}","received_events_url":"https://api.github.com/users/alahab2/received_events","type":"User","site_admin":false},"body":"Moved the logic to a method in the class\r\n```\r\n def top_donation_for_current_year\r\n    donations.where(\"donations.created_at BETWEEN ? AND ?\", Date.current.beginning_of_year, Date.current.end_of_year).order(\"amount DESC\").first\r\n  end\r\n```\r\nIs that ok?","created_at":"2016-11-09T07:56:57Z","updated_at":"2016-11-09T07:56:57Z","html_url":"https://github.com/TechLadies/highpoint/pull/82#discussion_r87145747","pull_request_url":"https://api.github.com/repos/TechLadies/highpoint/pulls/82","_links":{"self":{"href":"https://api.github.com/repos/TechLadies/highpoint/pulls/comments/87145747"},"html":{"href":"https://github.com/TechLadies/highpoint/pull/82#discussion_r87145747"},"pull_request":{"href":"https://api.github.com/repos/TechLadies/highpoint/pulls/82"}}},"pull_request":{"url":"https://api.github.com/repos/TechLadies/highpoint/pulls/82","id":92519113,"html_url":"https://github.com/TechLadies/highpoint/pull/82","diff_url":"https://github.com/TechLadies/highpoint/pull/82.diff","patch_url":"https://github.com/TechLadies/highpoint/pull/82.patch","issue_url":"https://api.github.com/repos/TechLadies/highpoint/issues/82","number":82,"state":"open","locked":false,"title":"Allow Users to see Top Donors per Cause on Dashboard page","user":{"login":"alahab2","id":19661205,"avatar_url":"https://avatars.githubusercontent.com/u/19661205?v=3","gravatar_id":"","url":"https://api.github.com/users/alahab2","html_url":"https://github.com/alahab2","followers_url":"https://api.github.com/users/alahab2/followers","following_url":"https://api.github.com/users/alahab2/following{/other_user}","gists_url":"https://api.github.com/users/alahab2/gists{/gist_id}","starred_url":"https://api.github.com/users/alahab2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alahab2/subscriptions","organizations_url":"https://api.github.com/users/alahab2/orgs","repos_url":"https://api.github.com/users/alahab2/repos","events_url":"https://api.github.com/users/alahab2/events{/privacy}","received_events_url":"https://api.github.com/users/alahab2/received_events","type":"User","site_admin":false},"body":"This change adds Topd Donors per `cause` to `donations#index` page.\r\n\r\n---\r\n\r\nSee the screenshot below:\r\n\r\n![screencapture-localhost-3000-donations-1478489113069](https://cloud.githubusercontent.com/assets/19661205/20045593/7c0f89ee-a4dd-11e6-93b4-b432259fb438.png)\r\n\r\n**Before submitting, check that:**\r\n\r\n - [ ] You have added (passing) tests for your code.\r\n - [x] You have written good* commit messages.\r\n - [x] You have squashed relevant commits together.\r\n - [x] You have ensured that RuboCop is passing.\r\n - [x] Your PR relates to one subject, with a clear title and\r\n       description using complete, grammatically correct sentences.\r\n\r\n---\r\n\r\nIf your change contains views, ensure that:\r\n\r\n - [x] You have included a screenshot of the new view.\r\n\r\n---\r\n\r\n*If you do not know what makes a good commit message, or why it\r\nis important, please refer to these resources: [1][1], [2][2], [3][3].\r\n\r\n[1]: https://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message\r\n[2]: http://chris.beams.io/posts/git-commit/\r\n[3]: https://github.com/blog/1943-how-to-write-the-perfect-pull-request\r\n\r\n\r\nFix event link on \"donors#show\" page\r\nAdd CSS styling","created_at":"2016-11-07T03:30:23Z","updated_at":"2016-11-09T07:56:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fcbe4122ccce0a4e94ec62e8eb7ab4e349116f9d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/TechLadies/highpoint/pulls/82/commits","review_comments_url":"https://api.github.com/repos/TechLadies/highpoint/pulls/82/comments","review_comment_url":"https://api.github.com/repos/TechLadies/highpoint/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TechLadies/highpoint/issues/82/comments","statuses_url":"https://api.github.com/repos/TechLadies/highpoint/statuses/07d261b3fb31dbb5ba038d29a5b6f8d9bb17f50a","head":{"label":"TechLadies:feature/top-donors","ref":"feature/top-donors","sha":"07d261b3fb31dbb5ba038d29a5b6f8d9bb17f50a","user":{"login":"TechLadies","id":17126475,"avatar_url":"https://avatars.githubusercontent.com/u/17126475?v=3","gravatar_id":"","url":"https://api.github.com/users/TechLadies","html_url":"https://github.com/TechLadies","followers_url":"https://api.github.com/users/TechLadies/followers","following_url":"https://api.github.com/users/TechLadies/following{/other_user}","gists_url":"https://api.github.com/users/TechLadies/gists{/gist_id}","starred_url":"https://api.github.com/users/TechLadies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TechLadies/subscriptions","organizations_url":"https://api.github.com/users/TechLadies/orgs","repos_url":"https://api.github.com/users/TechLadies/repos","events_url":"https://api.github.com/users/TechLadies/events{/privacy}","received_events_url":"https://api.github.com/users/TechLadies/received_events","type":"Organization","site_admin":false},"repo":{"id":69089908,"name":"highpoint","full_name":"TechLadies/highpoint","owner":{"login":"TechLadies","id":17126475,"avatar_url":"https://avatars.githubusercontent.com/u/17126475?v=3","gravatar_id":"","url":"https://api.github.com/users/TechLadies","html_url":"https://github.com/TechLadies","followers_url":"https://api.github.com/users/TechLadies/followers","following_url":"https://api.github.com/users/TechLadies/following{/other_user}","gists_url":"https://api.github.com/users/TechLadies/gists{/gist_id}","starred_url":"https://api.github.com/users/TechLadies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TechLadies/subscriptions","organizations_url":"https://api.github.com/users/TechLadies/orgs","repos_url":"https://api.github.com/users/TechLadies/repos","events_url":"https://api.github.com/users/TechLadies/events{/privacy}","received_events_url":"https://api.github.com/users/TechLadies/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TechLadies/highpoint","description":"Simple donation management system for HSCA","fork":false,"url":"https://api.github.com/repos/TechLadies/highpoint","forks_url":"https://api.github.com/repos/TechLadies/highpoint/forks","keys_url":"https://api.github.com/repos/TechLadies/highpoint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TechLadies/highpoint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TechLadies/highpoint/teams","hooks_url":"https://api.github.com/repos/TechLadies/highpoint/hooks","issue_events_url":"https://api.github.com/repos/TechLadies/highpoint/issues/events{/number}","events_url":"https://api.github.com/repos/TechLadies/highpoint/events","assignees_url":"https://api.github.com/repos/TechLadies/highpoint/assignees{/user}","branches_url":"https://api.github.com/repos/TechLadies/highpoint/branches{/branch}","tags_url":"https://api.github.com/repos/TechLadies/highpoint/tags","blobs_url":"https://api.github.com/repos/TechLadies/highpoint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TechLadies/highpoint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TechLadies/highpoint/git/refs{/sha}","trees_url":"https://api.github.com/repos/TechLadies/highpoint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TechLadies/highpoint/statuses/{sha}","languages_url":"https://api.github.com/repos/TechLadies/highpoint/languages","stargazers_url":"https://api.github.com/repos/TechLadies/highpoint/stargazers","contributors_url":"https://api.github.com/repos/TechLadies/highpoint/contributors","subscribers_url":"https://api.github.com/repos/TechLadies/highpoint/subscribers","subscription_url":"https://api.github.com/repos/TechLadies/highpoint/subscription","commits_url":"https://api.github.com/repos/TechLadies/highpoint/commits{/sha}","git_commits_url":"https://api.github.com/repos/TechLadies/highpoint/git/commits{/sha}","comments_url":"https://api.github.com/repos/TechLadies/highpoint/comments{/number}","issue_comment_url":"https://api.github.com/repos/TechLadies/highpoint/issues/comments{/number}","contents_url":"https://api.github.com/repos/TechLadies/highpoint/contents/{+path}","compare_url":"https://api.github.com/repos/TechLadies/highpoint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TechLadies/highpoint/merges","archive_url":"https://api.github.com/repos/TechLadies/highpoint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TechLadies/highpoint/downloads","issues_url":"https://api.github.com/repos/TechLadies/highpoint/issues{/number}","pulls_url":"https://api.github.com/repos/TechLadies/highpoint/pulls{/number}","milestones_url":"https://api.github.com/repos/TechLadies/highpoint/milestones{/number}","notifications_url":"https://api.github.com/repos/TechLadies/highpoint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TechLadies/highpoint/labels{/name}","releases_url":"https://api.github.com/repos/TechLadies/highpoint/releases{/id}","deployments_url":"https://api.github.com/repos/TechLadies/highpoint/deployments","created_at":"2016-09-24T08:21:55Z","updated_at":"2016-10-22T06:59:22Z","pushed_at":"2016-11-09T07:56:10Z","git_url":"git://github.com/TechLadies/highpoint.git","ssh_url":"git@github.com:TechLadies/highpoint.git","clone_url":"https://github.com/TechLadies/highpoint.git","svn_url":"https://github.com/TechLadies/highpoint","homepage":null,"size":160,"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":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"TechLadies:master","ref":"master","sha":"8161442a5a1d2bc218644048f166a7428c2731ad","user":{"login":"TechLadies","id":17126475,"avatar_url":"https://avatars.githubusercontent.com/u/17126475?v=3","gravatar_id":"","url":"https://api.github.com/users/TechLadies","html_url":"https://github.com/TechLadies","followers_url":"https://api.github.com/users/TechLadies/followers","following_url":"https://api.github.com/users/TechLadies/following{/other_user}","gists_url":"https://api.github.com/users/TechLadies/gists{/gist_id}","starred_url":"https://api.github.com/users/TechLadies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TechLadies/subscriptions","organizations_url":"https://api.github.com/users/TechLadies/orgs","repos_url":"https://api.github.com/users/TechLadies/repos","events_url":"https://api.github.com/users/TechLadies/events{/privacy}","received_events_url":"https://api.github.com/users/TechLadies/received_events","type":"Organization","site_admin":false},"repo":{"id":69089908,"name":"highpoint","full_name":"TechLadies/highpoint","owner":{"login":"TechLadies","id":17126475,"avatar_url":"https://avatars.githubusercontent.com/u/17126475?v=3","gravatar_id":"","url":"https://api.github.com/users/TechLadies","html_url":"https://github.com/TechLadies","followers_url":"https://api.github.com/users/TechLadies/followers","following_url":"https://api.github.com/users/TechLadies/following{/other_user}","gists_url":"https://api.github.com/users/TechLadies/gists{/gist_id}","starred_url":"https://api.github.com/users/TechLadies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TechLadies/subscriptions","organizations_url":"https://api.github.com/users/TechLadies/orgs","repos_url":"https://api.github.com/users/TechLadies/repos","events_url":"https://api.github.com/users/TechLadies/events{/privacy}","received_events_url":"https://api.github.com/users/TechLadies/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TechLadies/highpoint","description":"Simple donation management system for HSCA","fork":false,"url":"https://api.github.com/repos/TechLadies/highpoint","forks_url":"https://api.github.com/repos/TechLadies/highpoint/forks","keys_url":"https://api.github.com/repos/TechLadies/highpoint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TechLadies/highpoint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TechLadies/highpoint/teams","hooks_url":"https://api.github.com/repos/TechLadies/highpoint/hooks","issue_events_url":"https://api.github.com/repos/TechLadies/highpoint/issues/events{/number}","events_url":"https://api.github.com/repos/TechLadies/highpoint/events","assignees_url":"https://api.github.com/repos/TechLadies/highpoint/assignees{/user}","branches_url":"https://api.github.com/repos/TechLadies/highpoint/branches{/branch}","tags_url":"https://api.github.com/repos/TechLadies/highpoint/tags","blobs_url":"https://api.github.com/repos/TechLadies/highpoint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TechLadies/highpoint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TechLadies/highpoint/git/refs{/sha}","trees_url":"https://api.github.com/repos/TechLadies/highpoint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TechLadies/highpoint/statuses/{sha}","languages_url":"https://api.github.com/repos/TechLadies/highpoint/languages","stargazers_url":"https://api.github.com/repos/TechLadies/highpoint/stargazers","contributors_url":"https://api.github.com/repos/TechLadies/highpoint/contributors","subscribers_url":"https://api.github.com/repos/TechLadies/highpoint/subscribers","subscription_url":"https://api.github.com/repos/TechLadies/highpoint/subscription","commits_url":"https://api.github.com/repos/TechLadies/highpoint/commits{/sha}","git_commits_url":"https://api.github.com/repos/TechLadies/highpoint/git/commits{/sha}","comments_url":"https://api.github.com/repos/TechLadies/highpoint/comments{/number}","issue_comment_url":"https://api.github.com/repos/TechLadies/highpoint/issues/comments{/number}","contents_url":"https://api.github.com/repos/TechLadies/highpoint/contents/{+path}","compare_url":"https://api.github.com/repos/TechLadies/highpoint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TechLadies/highpoint/merges","archive_url":"https://api.github.com/repos/TechLadies/highpoint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TechLadies/highpoint/downloads","issues_url":"https://api.github.com/repos/TechLadies/highpoint/issues{/number}","pulls_url":"https://api.github.com/repos/TechLadies/highpoint/pulls{/number}","milestones_url":"https://api.github.com/repos/TechLadies/highpoint/milestones{/number}","notifications_url":"https://api.github.com/repos/TechLadies/highpoint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TechLadies/highpoint/labels{/name}","releases_url":"https://api.github.com/repos/TechLadies/highpoint/releases{/id}","deployments_url":"https://api.github.com/repos/TechLadies/highpoint/deployments","created_at":"2016-09-24T08:21:55Z","updated_at":"2016-10-22T06:59:22Z","pushed_at":"2016-11-09T07:56:10Z","git_url":"git://github.com/TechLadies/highpoint.git","ssh_url":"git@github.com:TechLadies/highpoint.git","clone_url":"https://github.com/TechLadies/highpoint.git","svn_url":"https://github.com/TechLadies/highpoint","homepage":null,"size":160,"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":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TechLadies/highpoint/pulls/82"},"html":{"href":"https://github.com/TechLadies/highpoint/pull/82"},"issue":{"href":"https://api.github.com/repos/TechLadies/highpoint/issues/82"},"comments":{"href":"https://api.github.com/repos/TechLadies/highpoint/issues/82/comments"},"review_comments":{"href":"https://api.github.com/repos/TechLadies/highpoint/pulls/82/comments"},"review_comment":{"href":"https://api.github.com/repos/TechLadies/highpoint/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TechLadies/highpoint/pulls/82/commits"},"statuses":{"href":"https://api.github.com/repos/TechLadies/highpoint/statuses/07d261b3fb31dbb5ba038d29a5b6f8d9bb17f50a"}}}}
{"actor":{"display_login":"alahab2"}}