{"action":"created","comment":{"url":"https://api.github.com/repos/nickcluc/golf/pulls/comments/25197401","id":25197401,"diff_hunk":"@@ -1,11 +1,73 @@\n class User < ActiveRecord::Base\n   has_many :rounds\n   has_many :player_rounds\n-  has_many :rounds, through: :player_rounds\n   has_many :courses\n   has_many :tees\n   # Include default devise modules. Others available are:\n   # :confirmable, :lockable, :timeoutable and :omniauthable\n   devise :database_authenticatable, :registerable,\n          :recoverable, :rememberable, :trackable, :validatable\n+\n+  def not_scored_rounds\n+    not_scored = []\n+      rounds.each do |round|\n+        if round.round_date < Date.today\n+          if round.score == nil\n+            not_scored << round\n+          end\n+        end\n+      end\n+    not_scored.last(3)\n+  end\n+\n+  def upcoming_rounds\n+    upcoming = []\n+    rounds.last(3).each do |round|\n+      if round.round_date > Date.today\n+        upcoming << round\n+      end\n+    end\n+    upcoming\n+  end\n+\n+  def handicap\n+    if player_rounds.count >= 5\n+      differentials = []\n+      player_rounds.each do |round|\n+        differentials << (round.score - round.tee.rating) * 113 / round.tee.slope","path":"app/models/user.rb","position":38,"original_position":38,"commit_id":"da5b0c5c8cc9d2085e8f2465f872a6273583b444","original_commit_id":"da5b0c5c8cc9d2085e8f2465f872a6273583b444","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":"Line is too long. [81/80]","created_at":"2015-02-23T20:14:13Z","updated_at":"2015-02-23T20:14:13Z","html_url":"https://github.com/nickcluc/golf/pull/6#discussion_r25197401","pull_request_url":"https://api.github.com/repos/nickcluc/golf/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/nickcluc/golf/pulls/comments/25197401"},"html":{"href":"https://github.com/nickcluc/golf/pull/6#discussion_r25197401"},"pull_request":{"href":"https://api.github.com/repos/nickcluc/golf/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/nickcluc/golf/pulls/6","id":29841218,"html_url":"https://github.com/nickcluc/golf/pull/6","diff_url":"https://github.com/nickcluc/golf/pull/6.diff","patch_url":"https://github.com/nickcluc/golf/pull/6.patch","issue_url":"https://api.github.com/repos/nickcluc/golf/issues/6","number":6,"state":"open","locked":false,"title":"Added user page & handicap calculation","user":{"login":"nickcluc","id":8691993,"avatar_url":"https://avatars.githubusercontent.com/u/8691993?v=3","gravatar_id":"","url":"https://api.github.com/users/nickcluc","html_url":"https://github.com/nickcluc","followers_url":"https://api.github.com/users/nickcluc/followers","following_url":"https://api.github.com/users/nickcluc/following{/other_user}","gists_url":"https://api.github.com/users/nickcluc/gists{/gist_id}","starred_url":"https://api.github.com/users/nickcluc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickcluc/subscriptions","organizations_url":"https://api.github.com/users/nickcluc/orgs","repos_url":"https://api.github.com/users/nickcluc/repos","events_url":"https://api.github.com/users/nickcluc/events{/privacy}","received_events_url":"https://api.github.com/users/nickcluc/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-23T20:14:08Z","updated_at":"2015-02-23T20:14:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"132062dd15836c5b268b763e4244361b37420353","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nickcluc/golf/pulls/6/commits","review_comments_url":"https://api.github.com/repos/nickcluc/golf/pulls/6/comments","review_comment_url":"https://api.github.com/repos/nickcluc/golf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nickcluc/golf/issues/6/comments","statuses_url":"https://api.github.com/repos/nickcluc/golf/statuses/da5b0c5c8cc9d2085e8f2465f872a6273583b444","head":{"label":"nickcluc:user_pages","ref":"user_pages","sha":"da5b0c5c8cc9d2085e8f2465f872a6273583b444","user":{"login":"nickcluc","id":8691993,"avatar_url":"https://avatars.githubusercontent.com/u/8691993?v=3","gravatar_id":"","url":"https://api.github.com/users/nickcluc","html_url":"https://github.com/nickcluc","followers_url":"https://api.github.com/users/nickcluc/followers","following_url":"https://api.github.com/users/nickcluc/following{/other_user}","gists_url":"https://api.github.com/users/nickcluc/gists{/gist_id}","starred_url":"https://api.github.com/users/nickcluc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickcluc/subscriptions","organizations_url":"https://api.github.com/users/nickcluc/orgs","repos_url":"https://api.github.com/users/nickcluc/repos","events_url":"https://api.github.com/users/nickcluc/events{/privacy}","received_events_url":"https://api.github.com/users/nickcluc/received_events","type":"User","site_admin":false},"repo":{"id":30880240,"name":"golf","full_name":"nickcluc/golf","owner":{"login":"nickcluc","id":8691993,"avatar_url":"https://avatars.githubusercontent.com/u/8691993?v=3","gravatar_id":"","url":"https://api.github.com/users/nickcluc","html_url":"https://github.com/nickcluc","followers_url":"https://api.github.com/users/nickcluc/followers","following_url":"https://api.github.com/users/nickcluc/following{/other_user}","gists_url":"https://api.github.com/users/nickcluc/gists{/gist_id}","starred_url":"https://api.github.com/users/nickcluc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickcluc/subscriptions","organizations_url":"https://api.github.com/users/nickcluc/orgs","repos_url":"https://api.github.com/users/nickcluc/repos","events_url":"https://api.github.com/users/nickcluc/events{/privacy}","received_events_url":"https://api.github.com/users/nickcluc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nickcluc/golf","description":"","fork":false,"url":"https://api.github.com/repos/nickcluc/golf","forks_url":"https://api.github.com/repos/nickcluc/golf/forks","keys_url":"https://api.github.com/repos/nickcluc/golf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nickcluc/golf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nickcluc/golf/teams","hooks_url":"https://api.github.com/repos/nickcluc/golf/hooks","issue_events_url":"https://api.github.com/repos/nickcluc/golf/issues/events{/number}","events_url":"https://api.github.com/repos/nickcluc/golf/events","assignees_url":"https://api.github.com/repos/nickcluc/golf/assignees{/user}","branches_url":"https://api.github.com/repos/nickcluc/golf/branches{/branch}","tags_url":"https://api.github.com/repos/nickcluc/golf/tags","blobs_url":"https://api.github.com/repos/nickcluc/golf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nickcluc/golf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nickcluc/golf/git/refs{/sha}","trees_url":"https://api.github.com/repos/nickcluc/golf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nickcluc/golf/statuses/{sha}","languages_url":"https://api.github.com/repos/nickcluc/golf/languages","stargazers_url":"https://api.github.com/repos/nickcluc/golf/stargazers","contributors_url":"https://api.github.com/repos/nickcluc/golf/contributors","subscribers_url":"https://api.github.com/repos/nickcluc/golf/subscribers","subscription_url":"https://api.github.com/repos/nickcluc/golf/subscription","commits_url":"https://api.github.com/repos/nickcluc/golf/commits{/sha}","git_commits_url":"https://api.github.com/repos/nickcluc/golf/git/commits{/sha}","comments_url":"https://api.github.com/repos/nickcluc/golf/comments{/number}","issue_comment_url":"https://api.github.com/repos/nickcluc/golf/issues/comments{/number}","contents_url":"https://api.github.com/repos/nickcluc/golf/contents/{+path}","compare_url":"https://api.github.com/repos/nickcluc/golf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nickcluc/golf/merges","archive_url":"https://api.github.com/repos/nickcluc/golf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nickcluc/golf/downloads","issues_url":"https://api.github.com/repos/nickcluc/golf/issues{/number}","pulls_url":"https://api.github.com/repos/nickcluc/golf/pulls{/number}","milestones_url":"https://api.github.com/repos/nickcluc/golf/milestones{/number}","notifications_url":"https://api.github.com/repos/nickcluc/golf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nickcluc/golf/labels{/name}","releases_url":"https://api.github.com/repos/nickcluc/golf/releases{/id}","created_at":"2015-02-16T17:47:23Z","updated_at":"2015-02-21T20:01:30Z","pushed_at":"2015-02-23T20:13:32Z","git_url":"git://github.com/nickcluc/golf.git","ssh_url":"git@github.com:nickcluc/golf.git","clone_url":"https://github.com/nickcluc/golf.git","svn_url":"https://github.com/nickcluc/golf","homepage":null,"size":1232,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"nickcluc:master","ref":"master","sha":"5c4e13d2cfe181887c3b045551f459b8de7f43cf","user":{"login":"nickcluc","id":8691993,"avatar_url":"https://avatars.githubusercontent.com/u/8691993?v=3","gravatar_id":"","url":"https://api.github.com/users/nickcluc","html_url":"https://github.com/nickcluc","followers_url":"https://api.github.com/users/nickcluc/followers","following_url":"https://api.github.com/users/nickcluc/following{/other_user}","gists_url":"https://api.github.com/users/nickcluc/gists{/gist_id}","starred_url":"https://api.github.com/users/nickcluc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickcluc/subscriptions","organizations_url":"https://api.github.com/users/nickcluc/orgs","repos_url":"https://api.github.com/users/nickcluc/repos","events_url":"https://api.github.com/users/nickcluc/events{/privacy}","received_events_url":"https://api.github.com/users/nickcluc/received_events","type":"User","site_admin":false},"repo":{"id":30880240,"name":"golf","full_name":"nickcluc/golf","owner":{"login":"nickcluc","id":8691993,"avatar_url":"https://avatars.githubusercontent.com/u/8691993?v=3","gravatar_id":"","url":"https://api.github.com/users/nickcluc","html_url":"https://github.com/nickcluc","followers_url":"https://api.github.com/users/nickcluc/followers","following_url":"https://api.github.com/users/nickcluc/following{/other_user}","gists_url":"https://api.github.com/users/nickcluc/gists{/gist_id}","starred_url":"https://api.github.com/users/nickcluc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickcluc/subscriptions","organizations_url":"https://api.github.com/users/nickcluc/orgs","repos_url":"https://api.github.com/users/nickcluc/repos","events_url":"https://api.github.com/users/nickcluc/events{/privacy}","received_events_url":"https://api.github.com/users/nickcluc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nickcluc/golf","description":"","fork":false,"url":"https://api.github.com/repos/nickcluc/golf","forks_url":"https://api.github.com/repos/nickcluc/golf/forks","keys_url":"https://api.github.com/repos/nickcluc/golf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nickcluc/golf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nickcluc/golf/teams","hooks_url":"https://api.github.com/repos/nickcluc/golf/hooks","issue_events_url":"https://api.github.com/repos/nickcluc/golf/issues/events{/number}","events_url":"https://api.github.com/repos/nickcluc/golf/events","assignees_url":"https://api.github.com/repos/nickcluc/golf/assignees{/user}","branches_url":"https://api.github.com/repos/nickcluc/golf/branches{/branch}","tags_url":"https://api.github.com/repos/nickcluc/golf/tags","blobs_url":"https://api.github.com/repos/nickcluc/golf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nickcluc/golf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nickcluc/golf/git/refs{/sha}","trees_url":"https://api.github.com/repos/nickcluc/golf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nickcluc/golf/statuses/{sha}","languages_url":"https://api.github.com/repos/nickcluc/golf/languages","stargazers_url":"https://api.github.com/repos/nickcluc/golf/stargazers","contributors_url":"https://api.github.com/repos/nickcluc/golf/contributors","subscribers_url":"https://api.github.com/repos/nickcluc/golf/subscribers","subscription_url":"https://api.github.com/repos/nickcluc/golf/subscription","commits_url":"https://api.github.com/repos/nickcluc/golf/commits{/sha}","git_commits_url":"https://api.github.com/repos/nickcluc/golf/git/commits{/sha}","comments_url":"https://api.github.com/repos/nickcluc/golf/comments{/number}","issue_comment_url":"https://api.github.com/repos/nickcluc/golf/issues/comments{/number}","contents_url":"https://api.github.com/repos/nickcluc/golf/contents/{+path}","compare_url":"https://api.github.com/repos/nickcluc/golf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nickcluc/golf/merges","archive_url":"https://api.github.com/repos/nickcluc/golf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nickcluc/golf/downloads","issues_url":"https://api.github.com/repos/nickcluc/golf/issues{/number}","pulls_url":"https://api.github.com/repos/nickcluc/golf/pulls{/number}","milestones_url":"https://api.github.com/repos/nickcluc/golf/milestones{/number}","notifications_url":"https://api.github.com/repos/nickcluc/golf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nickcluc/golf/labels{/name}","releases_url":"https://api.github.com/repos/nickcluc/golf/releases{/id}","created_at":"2015-02-16T17:47:23Z","updated_at":"2015-02-21T20:01:30Z","pushed_at":"2015-02-23T20:13:32Z","git_url":"git://github.com/nickcluc/golf.git","ssh_url":"git@github.com:nickcluc/golf.git","clone_url":"https://github.com/nickcluc/golf.git","svn_url":"https://github.com/nickcluc/golf","homepage":null,"size":1232,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nickcluc/golf/pulls/6"},"html":{"href":"https://github.com/nickcluc/golf/pull/6"},"issue":{"href":"https://api.github.com/repos/nickcluc/golf/issues/6"},"comments":{"href":"https://api.github.com/repos/nickcluc/golf/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/nickcluc/golf/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/nickcluc/golf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nickcluc/golf/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/nickcluc/golf/statuses/da5b0c5c8cc9d2085e8f2465f872a6273583b444"}}}}