{"action":"created","comment":{"url":"https://api.github.com/repos/devbootstrap/games/pulls/comments/35832884","id":35832884,"diff_hunk":"@@ -32,9 +32,19 @@ def dislike_game\n     redirect_to @game\n   end\n \n-  def favorite_game\n-    @game.vote_by :voter => current_user\n-    redirect_to @game\n+  def favorite\n+    type = params[:type]\n+    if type == \"favorite\"\n+      current_user.favorites << @game\n+      redirect_to :back, notice: 'You favorited #{@recipe.name}'\n+\n+    elsif type == \"unfavorite\"\n+      current_user.favorites.delete(@game)","path":"app/controllers/games_controller.rb","position":21,"original_position":21,"commit_id":"9cd94d39ec1105e89321bf40e575136fc7363ec6","original_commit_id":"9cd94d39ec1105e89321bf40e575136fc7363ec6","user":{"login":"jensendarren","id":165351,"avatar_url":"https://avatars.githubusercontent.com/u/165351?v=3","gravatar_id":"","url":"https://api.github.com/users/jensendarren","html_url":"https://github.com/jensendarren","followers_url":"https://api.github.com/users/jensendarren/followers","following_url":"https://api.github.com/users/jensendarren/following{/other_user}","gists_url":"https://api.github.com/users/jensendarren/gists{/gist_id}","starred_url":"https://api.github.com/users/jensendarren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jensendarren/subscriptions","organizations_url":"https://api.github.com/users/jensendarren/orgs","repos_url":"https://api.github.com/users/jensendarren/repos","events_url":"https://api.github.com/users/jensendarren/events{/privacy}","received_events_url":"https://api.github.com/users/jensendarren/received_events","type":"User","site_admin":false},"body":"...same here \r\n    @game.remove_favorite(current_user)","created_at":"2015-07-30T02:19:38Z","updated_at":"2015-07-30T02:19:38Z","html_url":"https://github.com/devbootstrap/games/pull/12#discussion_r35832884","pull_request_url":"https://api.github.com/repos/devbootstrap/games/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/devbootstrap/games/pulls/comments/35832884"},"html":{"href":"https://github.com/devbootstrap/games/pull/12#discussion_r35832884"},"pull_request":{"href":"https://api.github.com/repos/devbootstrap/games/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/devbootstrap/games/pulls/12","id":41190935,"html_url":"https://github.com/devbootstrap/games/pull/12","diff_url":"https://github.com/devbootstrap/games/pull/12.diff","patch_url":"https://github.com/devbootstrap/games/pull/12.patch","issue_url":"https://api.github.com/repos/devbootstrap/games/issues/12","number":12,"state":"closed","locked":false,"title":"Fix Favoite Game and Refectoring Some Junk Code","user":{"login":"Phanithism","id":8882194,"avatar_url":"https://avatars.githubusercontent.com/u/8882194?v=3","gravatar_id":"","url":"https://api.github.com/users/Phanithism","html_url":"https://github.com/Phanithism","followers_url":"https://api.github.com/users/Phanithism/followers","following_url":"https://api.github.com/users/Phanithism/following{/other_user}","gists_url":"https://api.github.com/users/Phanithism/gists{/gist_id}","starred_url":"https://api.github.com/users/Phanithism/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Phanithism/subscriptions","organizations_url":"https://api.github.com/users/Phanithism/orgs","repos_url":"https://api.github.com/users/Phanithism/repos","events_url":"https://api.github.com/users/Phanithism/events{/privacy}","received_events_url":"https://api.github.com/users/Phanithism/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-30T01:46:29Z","updated_at":"2015-07-30T02:19:38Z","closed_at":"2015-07-30T01:49:57Z","merged_at":"2015-07-30T01:49:57Z","merge_commit_sha":"3788c15ff9135d36af7ffaafafd7bceb2a5e1e93","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/devbootstrap/games/pulls/12/commits","review_comments_url":"https://api.github.com/repos/devbootstrap/games/pulls/12/comments","review_comment_url":"https://api.github.com/repos/devbootstrap/games/pulls/comments{/number}","comments_url":"https://api.github.com/repos/devbootstrap/games/issues/12/comments","statuses_url":"https://api.github.com/repos/devbootstrap/games/statuses/9cd94d39ec1105e89321bf40e575136fc7363ec6","head":{"label":"devbootstrap:Refectoring_Code","ref":"Refectoring_Code","sha":"9cd94d39ec1105e89321bf40e575136fc7363ec6","user":{"login":"devbootstrap","id":8535515,"avatar_url":"https://avatars.githubusercontent.com/u/8535515?v=3","gravatar_id":"","url":"https://api.github.com/users/devbootstrap","html_url":"https://github.com/devbootstrap","followers_url":"https://api.github.com/users/devbootstrap/followers","following_url":"https://api.github.com/users/devbootstrap/following{/other_user}","gists_url":"https://api.github.com/users/devbootstrap/gists{/gist_id}","starred_url":"https://api.github.com/users/devbootstrap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devbootstrap/subscriptions","organizations_url":"https://api.github.com/users/devbootstrap/orgs","repos_url":"https://api.github.com/users/devbootstrap/repos","events_url":"https://api.github.com/users/devbootstrap/events{/privacy}","received_events_url":"https://api.github.com/users/devbootstrap/received_events","type":"Organization","site_admin":false},"repo":{"id":39752063,"name":"games","full_name":"devbootstrap/games","owner":{"login":"devbootstrap","id":8535515,"avatar_url":"https://avatars.githubusercontent.com/u/8535515?v=3","gravatar_id":"","url":"https://api.github.com/users/devbootstrap","html_url":"https://github.com/devbootstrap","followers_url":"https://api.github.com/users/devbootstrap/followers","following_url":"https://api.github.com/users/devbootstrap/following{/other_user}","gists_url":"https://api.github.com/users/devbootstrap/gists{/gist_id}","starred_url":"https://api.github.com/users/devbootstrap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devbootstrap/subscriptions","organizations_url":"https://api.github.com/users/devbootstrap/orgs","repos_url":"https://api.github.com/users/devbootstrap/repos","events_url":"https://api.github.com/users/devbootstrap/events{/privacy}","received_events_url":"https://api.github.com/users/devbootstrap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/devbootstrap/games","description":"Cohort 2015.Q3 : Games directory site for project week ","fork":false,"url":"https://api.github.com/repos/devbootstrap/games","forks_url":"https://api.github.com/repos/devbootstrap/games/forks","keys_url":"https://api.github.com/repos/devbootstrap/games/keys{/key_id}","collaborators_url":"https://api.github.com/repos/devbootstrap/games/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/devbootstrap/games/teams","hooks_url":"https://api.github.com/repos/devbootstrap/games/hooks","issue_events_url":"https://api.github.com/repos/devbootstrap/games/issues/events{/number}","events_url":"https://api.github.com/repos/devbootstrap/games/events","assignees_url":"https://api.github.com/repos/devbootstrap/games/assignees{/user}","branches_url":"https://api.github.com/repos/devbootstrap/games/branches{/branch}","tags_url":"https://api.github.com/repos/devbootstrap/games/tags","blobs_url":"https://api.github.com/repos/devbootstrap/games/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/devbootstrap/games/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/devbootstrap/games/git/refs{/sha}","trees_url":"https://api.github.com/repos/devbootstrap/games/git/trees{/sha}","statuses_url":"https://api.github.com/repos/devbootstrap/games/statuses/{sha}","languages_url":"https://api.github.com/repos/devbootstrap/games/languages","stargazers_url":"https://api.github.com/repos/devbootstrap/games/stargazers","contributors_url":"https://api.github.com/repos/devbootstrap/games/contributors","subscribers_url":"https://api.github.com/repos/devbootstrap/games/subscribers","subscription_url":"https://api.github.com/repos/devbootstrap/games/subscription","commits_url":"https://api.github.com/repos/devbootstrap/games/commits{/sha}","git_commits_url":"https://api.github.com/repos/devbootstrap/games/git/commits{/sha}","comments_url":"https://api.github.com/repos/devbootstrap/games/comments{/number}","issue_comment_url":"https://api.github.com/repos/devbootstrap/games/issues/comments{/number}","contents_url":"https://api.github.com/repos/devbootstrap/games/contents/{+path}","compare_url":"https://api.github.com/repos/devbootstrap/games/compare/{base}...{head}","merges_url":"https://api.github.com/repos/devbootstrap/games/merges","archive_url":"https://api.github.com/repos/devbootstrap/games/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/devbootstrap/games/downloads","issues_url":"https://api.github.com/repos/devbootstrap/games/issues{/number}","pulls_url":"https://api.github.com/repos/devbootstrap/games/pulls{/number}","milestones_url":"https://api.github.com/repos/devbootstrap/games/milestones{/number}","notifications_url":"https://api.github.com/repos/devbootstrap/games/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/devbootstrap/games/labels{/name}","releases_url":"https://api.github.com/repos/devbootstrap/games/releases{/id}","created_at":"2015-07-27T02:56:57Z","updated_at":"2015-07-27T03:48:54Z","pushed_at":"2015-07-30T01:50:00Z","git_url":"git://github.com/devbootstrap/games.git","ssh_url":"git@github.com:devbootstrap/games.git","clone_url":"https://github.com/devbootstrap/games.git","svn_url":"https://github.com/devbootstrap/games","homepage":null,"size":0,"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":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"devbootstrap:master","ref":"master","sha":"486e0576b2571f7be7912b570fd94741504018be","user":{"login":"devbootstrap","id":8535515,"avatar_url":"https://avatars.githubusercontent.com/u/8535515?v=3","gravatar_id":"","url":"https://api.github.com/users/devbootstrap","html_url":"https://github.com/devbootstrap","followers_url":"https://api.github.com/users/devbootstrap/followers","following_url":"https://api.github.com/users/devbootstrap/following{/other_user}","gists_url":"https://api.github.com/users/devbootstrap/gists{/gist_id}","starred_url":"https://api.github.com/users/devbootstrap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devbootstrap/subscriptions","organizations_url":"https://api.github.com/users/devbootstrap/orgs","repos_url":"https://api.github.com/users/devbootstrap/repos","events_url":"https://api.github.com/users/devbootstrap/events{/privacy}","received_events_url":"https://api.github.com/users/devbootstrap/received_events","type":"Organization","site_admin":false},"repo":{"id":39752063,"name":"games","full_name":"devbootstrap/games","owner":{"login":"devbootstrap","id":8535515,"avatar_url":"https://avatars.githubusercontent.com/u/8535515?v=3","gravatar_id":"","url":"https://api.github.com/users/devbootstrap","html_url":"https://github.com/devbootstrap","followers_url":"https://api.github.com/users/devbootstrap/followers","following_url":"https://api.github.com/users/devbootstrap/following{/other_user}","gists_url":"https://api.github.com/users/devbootstrap/gists{/gist_id}","starred_url":"https://api.github.com/users/devbootstrap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devbootstrap/subscriptions","organizations_url":"https://api.github.com/users/devbootstrap/orgs","repos_url":"https://api.github.com/users/devbootstrap/repos","events_url":"https://api.github.com/users/devbootstrap/events{/privacy}","received_events_url":"https://api.github.com/users/devbootstrap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/devbootstrap/games","description":"Cohort 2015.Q3 : Games directory site for project week ","fork":false,"url":"https://api.github.com/repos/devbootstrap/games","forks_url":"https://api.github.com/repos/devbootstrap/games/forks","keys_url":"https://api.github.com/repos/devbootstrap/games/keys{/key_id}","collaborators_url":"https://api.github.com/repos/devbootstrap/games/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/devbootstrap/games/teams","hooks_url":"https://api.github.com/repos/devbootstrap/games/hooks","issue_events_url":"https://api.github.com/repos/devbootstrap/games/issues/events{/number}","events_url":"https://api.github.com/repos/devbootstrap/games/events","assignees_url":"https://api.github.com/repos/devbootstrap/games/assignees{/user}","branches_url":"https://api.github.com/repos/devbootstrap/games/branches{/branch}","tags_url":"https://api.github.com/repos/devbootstrap/games/tags","blobs_url":"https://api.github.com/repos/devbootstrap/games/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/devbootstrap/games/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/devbootstrap/games/git/refs{/sha}","trees_url":"https://api.github.com/repos/devbootstrap/games/git/trees{/sha}","statuses_url":"https://api.github.com/repos/devbootstrap/games/statuses/{sha}","languages_url":"https://api.github.com/repos/devbootstrap/games/languages","stargazers_url":"https://api.github.com/repos/devbootstrap/games/stargazers","contributors_url":"https://api.github.com/repos/devbootstrap/games/contributors","subscribers_url":"https://api.github.com/repos/devbootstrap/games/subscribers","subscription_url":"https://api.github.com/repos/devbootstrap/games/subscription","commits_url":"https://api.github.com/repos/devbootstrap/games/commits{/sha}","git_commits_url":"https://api.github.com/repos/devbootstrap/games/git/commits{/sha}","comments_url":"https://api.github.com/repos/devbootstrap/games/comments{/number}","issue_comment_url":"https://api.github.com/repos/devbootstrap/games/issues/comments{/number}","contents_url":"https://api.github.com/repos/devbootstrap/games/contents/{+path}","compare_url":"https://api.github.com/repos/devbootstrap/games/compare/{base}...{head}","merges_url":"https://api.github.com/repos/devbootstrap/games/merges","archive_url":"https://api.github.com/repos/devbootstrap/games/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/devbootstrap/games/downloads","issues_url":"https://api.github.com/repos/devbootstrap/games/issues{/number}","pulls_url":"https://api.github.com/repos/devbootstrap/games/pulls{/number}","milestones_url":"https://api.github.com/repos/devbootstrap/games/milestones{/number}","notifications_url":"https://api.github.com/repos/devbootstrap/games/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/devbootstrap/games/labels{/name}","releases_url":"https://api.github.com/repos/devbootstrap/games/releases{/id}","created_at":"2015-07-27T02:56:57Z","updated_at":"2015-07-27T03:48:54Z","pushed_at":"2015-07-30T01:50:00Z","git_url":"git://github.com/devbootstrap/games.git","ssh_url":"git@github.com:devbootstrap/games.git","clone_url":"https://github.com/devbootstrap/games.git","svn_url":"https://github.com/devbootstrap/games","homepage":null,"size":0,"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":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/devbootstrap/games/pulls/12"},"html":{"href":"https://github.com/devbootstrap/games/pull/12"},"issue":{"href":"https://api.github.com/repos/devbootstrap/games/issues/12"},"comments":{"href":"https://api.github.com/repos/devbootstrap/games/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/devbootstrap/games/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/devbootstrap/games/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/devbootstrap/games/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/devbootstrap/games/statuses/9cd94d39ec1105e89321bf40e575136fc7363ec6"}}}}