{"action":"created","comment":{"url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/pulls/comments/41173915","id":41173915,"diff_hunk":"@@ -16,12 +17,18 @@ def update\n     \t@color = 'black'\n     end\n \n+    if @last_move == 0","path":"app/controllers/pieces_controller.rb","position":12,"original_position":12,"commit_id":"5fd4bde1ff78efc5d07687cad813b4e371e2e87b","original_commit_id":"5fd4bde1ff78efc5d07687cad813b4e371e2e87b","user":{"login":"johnnyiller","id":193057,"avatar_url":"https://avatars.githubusercontent.com/u/193057?v=3","gravatar_id":"","url":"https://api.github.com/users/johnnyiller","html_url":"https://github.com/johnnyiller","followers_url":"https://api.github.com/users/johnnyiller/followers","following_url":"https://api.github.com/users/johnnyiller/following{/other_user}","gists_url":"https://api.github.com/users/johnnyiller/gists{/gist_id}","starred_url":"https://api.github.com/users/johnnyiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnnyiller/subscriptions","organizations_url":"https://api.github.com/users/johnnyiller/orgs","repos_url":"https://api.github.com/users/johnnyiller/repos","events_url":"https://api.github.com/users/johnnyiller/events{/privacy}","received_events_url":"https://api.github.com/users/johnnyiller/received_events","type":"User","site_admin":false},"body":"again use \r\n\r\nPiece::COLORS[:black] == @last_move\r\n\r\nalternatively you could implement a pair of methods in the pieces model and use those throughout the app.\r\n\r\ndef is_black?\r\n  self.color == Piece::COLORS[:black]\r\nend\r\n\r\ndef is_white?\r\n  !is_black?\r\nend\r\n\r\nJust a suggestion\r\n","created_at":"2015-10-05T17:45:08Z","updated_at":"2015-10-05T17:45:08Z","html_url":"https://github.com/Firehose-Team-Awesome/chess-game/pull/31#discussion_r41173915","pull_request_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/pulls/31","_links":{"self":{"href":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/pulls/comments/41173915"},"html":{"href":"https://github.com/Firehose-Team-Awesome/chess-game/pull/31#discussion_r41173915"},"pull_request":{"href":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/pulls/31"}}},"pull_request":{"url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/pulls/31","id":46804136,"html_url":"https://github.com/Firehose-Team-Awesome/chess-game/pull/31","diff_url":"https://github.com/Firehose-Team-Awesome/chess-game/pull/31.diff","patch_url":"https://github.com/Firehose-Team-Awesome/chess-game/pull/31.patch","issue_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/issues/31","number":31,"state":"open","locked":false,"title":"Finish check","user":{"login":"shaunshapiro","id":12422111,"avatar_url":"https://avatars.githubusercontent.com/u/12422111?v=3","gravatar_id":"","url":"https://api.github.com/users/shaunshapiro","html_url":"https://github.com/shaunshapiro","followers_url":"https://api.github.com/users/shaunshapiro/followers","following_url":"https://api.github.com/users/shaunshapiro/following{/other_user}","gists_url":"https://api.github.com/users/shaunshapiro/gists{/gist_id}","starred_url":"https://api.github.com/users/shaunshapiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shaunshapiro/subscriptions","organizations_url":"https://api.github.com/users/shaunshapiro/orgs","repos_url":"https://api.github.com/users/shaunshapiro/repos","events_url":"https://api.github.com/users/shaunshapiro/events{/privacy}","received_events_url":"https://api.github.com/users/shaunshapiro/received_events","type":"User","site_admin":false},"body":"Displays on game page if either user is in check. However, the check method itself doesn't seem to work quite right, and I think it's due to the logic in can_move_with_capture? in models/piece.rb not taking into account how each piece moves, due to it not calling valid_move?...","created_at":"2015-10-05T16:40:47Z","updated_at":"2015-10-05T17:45:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1cd8003bacfbfdc940b76b025fcd19a788a24ed3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/pulls/31/commits","review_comments_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/pulls/31/comments","review_comment_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/issues/31/comments","statuses_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/statuses/5fd4bde1ff78efc5d07687cad813b4e371e2e87b","head":{"label":"Firehose-Team-Awesome:finish_check","ref":"finish_check","sha":"5fd4bde1ff78efc5d07687cad813b4e371e2e87b","user":{"login":"Firehose-Team-Awesome","id":13895039,"avatar_url":"https://avatars.githubusercontent.com/u/13895039?v=3","gravatar_id":"","url":"https://api.github.com/users/Firehose-Team-Awesome","html_url":"https://github.com/Firehose-Team-Awesome","followers_url":"https://api.github.com/users/Firehose-Team-Awesome/followers","following_url":"https://api.github.com/users/Firehose-Team-Awesome/following{/other_user}","gists_url":"https://api.github.com/users/Firehose-Team-Awesome/gists{/gist_id}","starred_url":"https://api.github.com/users/Firehose-Team-Awesome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Firehose-Team-Awesome/subscriptions","organizations_url":"https://api.github.com/users/Firehose-Team-Awesome/orgs","repos_url":"https://api.github.com/users/Firehose-Team-Awesome/repos","events_url":"https://api.github.com/users/Firehose-Team-Awesome/events{/privacy}","received_events_url":"https://api.github.com/users/Firehose-Team-Awesome/received_events","type":"Organization","site_admin":false},"repo":{"id":41308280,"name":"chess-game","full_name":"Firehose-Team-Awesome/chess-game","owner":{"login":"Firehose-Team-Awesome","id":13895039,"avatar_url":"https://avatars.githubusercontent.com/u/13895039?v=3","gravatar_id":"","url":"https://api.github.com/users/Firehose-Team-Awesome","html_url":"https://github.com/Firehose-Team-Awesome","followers_url":"https://api.github.com/users/Firehose-Team-Awesome/followers","following_url":"https://api.github.com/users/Firehose-Team-Awesome/following{/other_user}","gists_url":"https://api.github.com/users/Firehose-Team-Awesome/gists{/gist_id}","starred_url":"https://api.github.com/users/Firehose-Team-Awesome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Firehose-Team-Awesome/subscriptions","organizations_url":"https://api.github.com/users/Firehose-Team-Awesome/orgs","repos_url":"https://api.github.com/users/Firehose-Team-Awesome/repos","events_url":"https://api.github.com/users/Firehose-Team-Awesome/events{/privacy}","received_events_url":"https://api.github.com/users/Firehose-Team-Awesome/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Firehose-Team-Awesome/chess-game","description":"chess-game","fork":false,"url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game","forks_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/forks","keys_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/teams","hooks_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/hooks","issue_events_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/issues/events{/number}","events_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/events","assignees_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/assignees{/user}","branches_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/branches{/branch}","tags_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/tags","blobs_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/git/refs{/sha}","trees_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/statuses/{sha}","languages_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/languages","stargazers_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/stargazers","contributors_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/contributors","subscribers_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/subscribers","subscription_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/subscription","commits_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/commits{/sha}","git_commits_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/git/commits{/sha}","comments_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/comments{/number}","issue_comment_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/issues/comments{/number}","contents_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/contents/{+path}","compare_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/merges","archive_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/downloads","issues_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/issues{/number}","pulls_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/pulls{/number}","milestones_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/milestones{/number}","notifications_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/labels{/name}","releases_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/releases{/id}","created_at":"2015-08-24T14:36:54Z","updated_at":"2015-08-24T14:40:12Z","pushed_at":"2015-10-05T16:40:47Z","git_url":"git://github.com/Firehose-Team-Awesome/chess-game.git","ssh_url":"git@github.com:Firehose-Team-Awesome/chess-game.git","clone_url":"https://github.com/Firehose-Team-Awesome/chess-game.git","svn_url":"https://github.com/Firehose-Team-Awesome/chess-game","homepage":null,"size":1843,"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":"Firehose-Team-Awesome:master","ref":"master","sha":"041e4be7837e01715d09e5ed8a0eee622dc0ccd6","user":{"login":"Firehose-Team-Awesome","id":13895039,"avatar_url":"https://avatars.githubusercontent.com/u/13895039?v=3","gravatar_id":"","url":"https://api.github.com/users/Firehose-Team-Awesome","html_url":"https://github.com/Firehose-Team-Awesome","followers_url":"https://api.github.com/users/Firehose-Team-Awesome/followers","following_url":"https://api.github.com/users/Firehose-Team-Awesome/following{/other_user}","gists_url":"https://api.github.com/users/Firehose-Team-Awesome/gists{/gist_id}","starred_url":"https://api.github.com/users/Firehose-Team-Awesome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Firehose-Team-Awesome/subscriptions","organizations_url":"https://api.github.com/users/Firehose-Team-Awesome/orgs","repos_url":"https://api.github.com/users/Firehose-Team-Awesome/repos","events_url":"https://api.github.com/users/Firehose-Team-Awesome/events{/privacy}","received_events_url":"https://api.github.com/users/Firehose-Team-Awesome/received_events","type":"Organization","site_admin":false},"repo":{"id":41308280,"name":"chess-game","full_name":"Firehose-Team-Awesome/chess-game","owner":{"login":"Firehose-Team-Awesome","id":13895039,"avatar_url":"https://avatars.githubusercontent.com/u/13895039?v=3","gravatar_id":"","url":"https://api.github.com/users/Firehose-Team-Awesome","html_url":"https://github.com/Firehose-Team-Awesome","followers_url":"https://api.github.com/users/Firehose-Team-Awesome/followers","following_url":"https://api.github.com/users/Firehose-Team-Awesome/following{/other_user}","gists_url":"https://api.github.com/users/Firehose-Team-Awesome/gists{/gist_id}","starred_url":"https://api.github.com/users/Firehose-Team-Awesome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Firehose-Team-Awesome/subscriptions","organizations_url":"https://api.github.com/users/Firehose-Team-Awesome/orgs","repos_url":"https://api.github.com/users/Firehose-Team-Awesome/repos","events_url":"https://api.github.com/users/Firehose-Team-Awesome/events{/privacy}","received_events_url":"https://api.github.com/users/Firehose-Team-Awesome/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Firehose-Team-Awesome/chess-game","description":"chess-game","fork":false,"url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game","forks_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/forks","keys_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/teams","hooks_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/hooks","issue_events_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/issues/events{/number}","events_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/events","assignees_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/assignees{/user}","branches_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/branches{/branch}","tags_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/tags","blobs_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/git/refs{/sha}","trees_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/statuses/{sha}","languages_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/languages","stargazers_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/stargazers","contributors_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/contributors","subscribers_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/subscribers","subscription_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/subscription","commits_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/commits{/sha}","git_commits_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/git/commits{/sha}","comments_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/comments{/number}","issue_comment_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/issues/comments{/number}","contents_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/contents/{+path}","compare_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/merges","archive_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/downloads","issues_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/issues{/number}","pulls_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/pulls{/number}","milestones_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/milestones{/number}","notifications_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/labels{/name}","releases_url":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/releases{/id}","created_at":"2015-08-24T14:36:54Z","updated_at":"2015-08-24T14:40:12Z","pushed_at":"2015-10-05T16:40:47Z","git_url":"git://github.com/Firehose-Team-Awesome/chess-game.git","ssh_url":"git@github.com:Firehose-Team-Awesome/chess-game.git","clone_url":"https://github.com/Firehose-Team-Awesome/chess-game.git","svn_url":"https://github.com/Firehose-Team-Awesome/chess-game","homepage":null,"size":1843,"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/Firehose-Team-Awesome/chess-game/pulls/31"},"html":{"href":"https://github.com/Firehose-Team-Awesome/chess-game/pull/31"},"issue":{"href":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/issues/31"},"comments":{"href":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/Firehose-Team-Awesome/chess-game/statuses/5fd4bde1ff78efc5d07687cad813b4e371e2e87b"}}}}