{"action":"created","comment":{"url":"https://api.github.com/repos/sudo-chess/chess-app/pulls/comments/154332927","pull_request_review_id":80480220,"id":154332927,"diff_hunk":"@@ -1,10 +1,38 @@\n class Pawn < Piece\n-  \n   def self.get_image(color)\n     if color == \"white\"\n       return \"chess_piece_pawn_white.png\"\n     elsif color == \"black\"\n       return \"chess_piece_pawn_black.png\"\n     end\n   end\n+\n+  def valid_move?(x,y)\n+    @object = self.game.pieces.where(position_x: x, position_y: y)[0]","path":"app/models/pawn.rb","position":12,"original_position":12,"commit_id":"fd66c099f11fe91777f647a32fe5b1e492e77cc2","original_commit_id":"fd66c099f11fe91777f647a32fe5b1e492e77cc2","user":{"login":"ilyakrasnov","id":3777545,"avatar_url":"https://avatars2.githubusercontent.com/u/3777545?v=4","gravatar_id":"","url":"https://api.github.com/users/ilyakrasnov","html_url":"https://github.com/ilyakrasnov","followers_url":"https://api.github.com/users/ilyakrasnov/followers","following_url":"https://api.github.com/users/ilyakrasnov/following{/other_user}","gists_url":"https://api.github.com/users/ilyakrasnov/gists{/gist_id}","starred_url":"https://api.github.com/users/ilyakrasnov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilyakrasnov/subscriptions","organizations_url":"https://api.github.com/users/ilyakrasnov/orgs","repos_url":"https://api.github.com/users/ilyakrasnov/repos","events_url":"https://api.github.com/users/ilyakrasnov/events{/privacy}","received_events_url":"https://api.github.com/users/ilyakrasnov/received_events","type":"User","site_admin":false},"body":"there are a few checks like `is_on_board?` or if its a piece of opposite color which can be done in the beginning of the method. i.e. if x&y are not on board, there is no need to calculate all the valid moves, right? the same is if it is my own piece at the destination.. \r\n\r\n--> lets add those checks in the beginning and return eliminate them there ","created_at":"2017-12-01T12:17:50Z","updated_at":"2017-12-01T12:24:36Z","html_url":"https://github.com/sudo-chess/chess-app/pull/54#discussion_r154332927","pull_request_url":"https://api.github.com/repos/sudo-chess/chess-app/pulls/54","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/sudo-chess/chess-app/pulls/comments/154332927"},"html":{"href":"https://github.com/sudo-chess/chess-app/pull/54#discussion_r154332927"},"pull_request":{"href":"https://api.github.com/repos/sudo-chess/chess-app/pulls/54"}}},"pull_request":{"url":"https://api.github.com/repos/sudo-chess/chess-app/pulls/54","id":155811667,"html_url":"https://github.com/sudo-chess/chess-app/pull/54","diff_url":"https://github.com/sudo-chess/chess-app/pull/54.diff","patch_url":"https://github.com/sudo-chess/chess-app/pull/54.patch","issue_url":"https://api.github.com/repos/sudo-chess/chess-app/issues/54","number":54,"state":"open","locked":false,"title":"Pawn vaild_move? method and rspec tests added ","user":{"login":"KyleDuca","id":2824224,"avatar_url":"https://avatars0.githubusercontent.com/u/2824224?v=4","gravatar_id":"","url":"https://api.github.com/users/KyleDuca","html_url":"https://github.com/KyleDuca","followers_url":"https://api.github.com/users/KyleDuca/followers","following_url":"https://api.github.com/users/KyleDuca/following{/other_user}","gists_url":"https://api.github.com/users/KyleDuca/gists{/gist_id}","starred_url":"https://api.github.com/users/KyleDuca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KyleDuca/subscriptions","organizations_url":"https://api.github.com/users/KyleDuca/orgs","repos_url":"https://api.github.com/users/KyleDuca/repos","events_url":"https://api.github.com/users/KyleDuca/events{/privacy}","received_events_url":"https://api.github.com/users/KyleDuca/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-12-01T08:56:53Z","updated_at":"2017-12-01T12:24:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6ba94a14eba52809dd657f7706fdf8f56cd01509","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/sudo-chess/chess-app/pulls/54/commits","review_comments_url":"https://api.github.com/repos/sudo-chess/chess-app/pulls/54/comments","review_comment_url":"https://api.github.com/repos/sudo-chess/chess-app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sudo-chess/chess-app/issues/54/comments","statuses_url":"https://api.github.com/repos/sudo-chess/chess-app/statuses/fd66c099f11fe91777f647a32fe5b1e492e77cc2","head":{"label":"sudo-chess:pawn","ref":"pawn","sha":"fd66c099f11fe91777f647a32fe5b1e492e77cc2","user":{"login":"sudo-chess","id":33468894,"avatar_url":"https://avatars3.githubusercontent.com/u/33468894?v=4","gravatar_id":"","url":"https://api.github.com/users/sudo-chess","html_url":"https://github.com/sudo-chess","followers_url":"https://api.github.com/users/sudo-chess/followers","following_url":"https://api.github.com/users/sudo-chess/following{/other_user}","gists_url":"https://api.github.com/users/sudo-chess/gists{/gist_id}","starred_url":"https://api.github.com/users/sudo-chess/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sudo-chess/subscriptions","organizations_url":"https://api.github.com/users/sudo-chess/orgs","repos_url":"https://api.github.com/users/sudo-chess/repos","events_url":"https://api.github.com/users/sudo-chess/events{/privacy}","received_events_url":"https://api.github.com/users/sudo-chess/received_events","type":"Organization","site_admin":false},"repo":{"id":109899892,"name":"chess-app","full_name":"sudo-chess/chess-app","owner":{"login":"sudo-chess","id":33468894,"avatar_url":"https://avatars3.githubusercontent.com/u/33468894?v=4","gravatar_id":"","url":"https://api.github.com/users/sudo-chess","html_url":"https://github.com/sudo-chess","followers_url":"https://api.github.com/users/sudo-chess/followers","following_url":"https://api.github.com/users/sudo-chess/following{/other_user}","gists_url":"https://api.github.com/users/sudo-chess/gists{/gist_id}","starred_url":"https://api.github.com/users/sudo-chess/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sudo-chess/subscriptions","organizations_url":"https://api.github.com/users/sudo-chess/orgs","repos_url":"https://api.github.com/users/sudo-chess/repos","events_url":"https://api.github.com/users/sudo-chess/events{/privacy}","received_events_url":"https://api.github.com/users/sudo-chess/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sudo-chess/chess-app","description":null,"fork":false,"url":"https://api.github.com/repos/sudo-chess/chess-app","forks_url":"https://api.github.com/repos/sudo-chess/chess-app/forks","keys_url":"https://api.github.com/repos/sudo-chess/chess-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sudo-chess/chess-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sudo-chess/chess-app/teams","hooks_url":"https://api.github.com/repos/sudo-chess/chess-app/hooks","issue_events_url":"https://api.github.com/repos/sudo-chess/chess-app/issues/events{/number}","events_url":"https://api.github.com/repos/sudo-chess/chess-app/events","assignees_url":"https://api.github.com/repos/sudo-chess/chess-app/assignees{/user}","branches_url":"https://api.github.com/repos/sudo-chess/chess-app/branches{/branch}","tags_url":"https://api.github.com/repos/sudo-chess/chess-app/tags","blobs_url":"https://api.github.com/repos/sudo-chess/chess-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sudo-chess/chess-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sudo-chess/chess-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/sudo-chess/chess-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sudo-chess/chess-app/statuses/{sha}","languages_url":"https://api.github.com/repos/sudo-chess/chess-app/languages","stargazers_url":"https://api.github.com/repos/sudo-chess/chess-app/stargazers","contributors_url":"https://api.github.com/repos/sudo-chess/chess-app/contributors","subscribers_url":"https://api.github.com/repos/sudo-chess/chess-app/subscribers","subscription_url":"https://api.github.com/repos/sudo-chess/chess-app/subscription","commits_url":"https://api.github.com/repos/sudo-chess/chess-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/sudo-chess/chess-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/sudo-chess/chess-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/sudo-chess/chess-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/sudo-chess/chess-app/contents/{+path}","compare_url":"https://api.github.com/repos/sudo-chess/chess-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sudo-chess/chess-app/merges","archive_url":"https://api.github.com/repos/sudo-chess/chess-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sudo-chess/chess-app/downloads","issues_url":"https://api.github.com/repos/sudo-chess/chess-app/issues{/number}","pulls_url":"https://api.github.com/repos/sudo-chess/chess-app/pulls{/number}","milestones_url":"https://api.github.com/repos/sudo-chess/chess-app/milestones{/number}","notifications_url":"https://api.github.com/repos/sudo-chess/chess-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sudo-chess/chess-app/labels{/name}","releases_url":"https://api.github.com/repos/sudo-chess/chess-app/releases{/id}","deployments_url":"https://api.github.com/repos/sudo-chess/chess-app/deployments","created_at":"2017-11-07T22:46:08Z","updated_at":"2017-11-20T02:37:11Z","pushed_at":"2017-12-01T08:56:54Z","git_url":"git://github.com/sudo-chess/chess-app.git","ssh_url":"git@github.com:sudo-chess/chess-app.git","clone_url":"https://github.com/sudo-chess/chess-app.git","svn_url":"https://github.com/sudo-chess/chess-app","homepage":"https://sudo-chess-app.herokuapp.com/","size":295,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":9,"license":null,"forks":1,"open_issues":9,"watchers":1,"default_branch":"master"}},"base":{"label":"sudo-chess:master","ref":"master","sha":"d499759a3c04fc0f237ecd8e4005613ce2d8b98d","user":{"login":"sudo-chess","id":33468894,"avatar_url":"https://avatars3.githubusercontent.com/u/33468894?v=4","gravatar_id":"","url":"https://api.github.com/users/sudo-chess","html_url":"https://github.com/sudo-chess","followers_url":"https://api.github.com/users/sudo-chess/followers","following_url":"https://api.github.com/users/sudo-chess/following{/other_user}","gists_url":"https://api.github.com/users/sudo-chess/gists{/gist_id}","starred_url":"https://api.github.com/users/sudo-chess/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sudo-chess/subscriptions","organizations_url":"https://api.github.com/users/sudo-chess/orgs","repos_url":"https://api.github.com/users/sudo-chess/repos","events_url":"https://api.github.com/users/sudo-chess/events{/privacy}","received_events_url":"https://api.github.com/users/sudo-chess/received_events","type":"Organization","site_admin":false},"repo":{"id":109899892,"name":"chess-app","full_name":"sudo-chess/chess-app","owner":{"login":"sudo-chess","id":33468894,"avatar_url":"https://avatars3.githubusercontent.com/u/33468894?v=4","gravatar_id":"","url":"https://api.github.com/users/sudo-chess","html_url":"https://github.com/sudo-chess","followers_url":"https://api.github.com/users/sudo-chess/followers","following_url":"https://api.github.com/users/sudo-chess/following{/other_user}","gists_url":"https://api.github.com/users/sudo-chess/gists{/gist_id}","starred_url":"https://api.github.com/users/sudo-chess/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sudo-chess/subscriptions","organizations_url":"https://api.github.com/users/sudo-chess/orgs","repos_url":"https://api.github.com/users/sudo-chess/repos","events_url":"https://api.github.com/users/sudo-chess/events{/privacy}","received_events_url":"https://api.github.com/users/sudo-chess/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sudo-chess/chess-app","description":null,"fork":false,"url":"https://api.github.com/repos/sudo-chess/chess-app","forks_url":"https://api.github.com/repos/sudo-chess/chess-app/forks","keys_url":"https://api.github.com/repos/sudo-chess/chess-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sudo-chess/chess-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sudo-chess/chess-app/teams","hooks_url":"https://api.github.com/repos/sudo-chess/chess-app/hooks","issue_events_url":"https://api.github.com/repos/sudo-chess/chess-app/issues/events{/number}","events_url":"https://api.github.com/repos/sudo-chess/chess-app/events","assignees_url":"https://api.github.com/repos/sudo-chess/chess-app/assignees{/user}","branches_url":"https://api.github.com/repos/sudo-chess/chess-app/branches{/branch}","tags_url":"https://api.github.com/repos/sudo-chess/chess-app/tags","blobs_url":"https://api.github.com/repos/sudo-chess/chess-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sudo-chess/chess-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sudo-chess/chess-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/sudo-chess/chess-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sudo-chess/chess-app/statuses/{sha}","languages_url":"https://api.github.com/repos/sudo-chess/chess-app/languages","stargazers_url":"https://api.github.com/repos/sudo-chess/chess-app/stargazers","contributors_url":"https://api.github.com/repos/sudo-chess/chess-app/contributors","subscribers_url":"https://api.github.com/repos/sudo-chess/chess-app/subscribers","subscription_url":"https://api.github.com/repos/sudo-chess/chess-app/subscription","commits_url":"https://api.github.com/repos/sudo-chess/chess-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/sudo-chess/chess-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/sudo-chess/chess-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/sudo-chess/chess-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/sudo-chess/chess-app/contents/{+path}","compare_url":"https://api.github.com/repos/sudo-chess/chess-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sudo-chess/chess-app/merges","archive_url":"https://api.github.com/repos/sudo-chess/chess-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sudo-chess/chess-app/downloads","issues_url":"https://api.github.com/repos/sudo-chess/chess-app/issues{/number}","pulls_url":"https://api.github.com/repos/sudo-chess/chess-app/pulls{/number}","milestones_url":"https://api.github.com/repos/sudo-chess/chess-app/milestones{/number}","notifications_url":"https://api.github.com/repos/sudo-chess/chess-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sudo-chess/chess-app/labels{/name}","releases_url":"https://api.github.com/repos/sudo-chess/chess-app/releases{/id}","deployments_url":"https://api.github.com/repos/sudo-chess/chess-app/deployments","created_at":"2017-11-07T22:46:08Z","updated_at":"2017-11-20T02:37:11Z","pushed_at":"2017-12-01T08:56:54Z","git_url":"git://github.com/sudo-chess/chess-app.git","ssh_url":"git@github.com:sudo-chess/chess-app.git","clone_url":"https://github.com/sudo-chess/chess-app.git","svn_url":"https://github.com/sudo-chess/chess-app","homepage":"https://sudo-chess-app.herokuapp.com/","size":295,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":9,"license":null,"forks":1,"open_issues":9,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sudo-chess/chess-app/pulls/54"},"html":{"href":"https://github.com/sudo-chess/chess-app/pull/54"},"issue":{"href":"https://api.github.com/repos/sudo-chess/chess-app/issues/54"},"comments":{"href":"https://api.github.com/repos/sudo-chess/chess-app/issues/54/comments"},"review_comments":{"href":"https://api.github.com/repos/sudo-chess/chess-app/pulls/54/comments"},"review_comment":{"href":"https://api.github.com/repos/sudo-chess/chess-app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sudo-chess/chess-app/pulls/54/commits"},"statuses":{"href":"https://api.github.com/repos/sudo-chess/chess-app/statuses/fd66c099f11fe91777f647a32fe5b1e492e77cc2"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"ilyakrasnov"}}