{"action":"created","comment":{"url":"https://api.github.com/repos/deepruby/chess/pulls/comments/45652331","id":45652331,"diff_hunk":"@@ -4,4 +4,53 @@ class Game < ActiveRecord::Base\n   belongs_to :black_player, class_name: 'User'\n \n   validates :name, presence: true\n-end\n+\n+  after_create :populate_board!\n+\n+  def populate_board!\n+\t\t# White Pieces\n+    (0..7).each do |i|","path":"app/models/game.rb","position":10,"original_position":10,"commit_id":"765d8217092f3f273bace04308d1a240643e58c2","original_commit_id":"765d8217092f3f273bace04308d1a240643e58c2","user":{"login":"lasley","id":7397578,"avatar_url":"https://avatars.githubusercontent.com/u/7397578?v=3","gravatar_id":"","url":"https://api.github.com/users/lasley","html_url":"https://github.com/lasley","followers_url":"https://api.github.com/users/lasley/followers","following_url":"https://api.github.com/users/lasley/following{/other_user}","gists_url":"https://api.github.com/users/lasley/gists{/gist_id}","starred_url":"https://api.github.com/users/lasley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lasley/subscriptions","organizations_url":"https://api.github.com/users/lasley/orgs","repos_url":"https://api.github.com/users/lasley/repos","events_url":"https://api.github.com/users/lasley/events{/privacy}","received_events_url":"https://api.github.com/users/lasley/received_events","type":"User","site_admin":false},"body":"What if there's already pieces on the board?","created_at":"2015-11-23T19:57:05Z","updated_at":"2015-11-23T19:57:05Z","html_url":"https://github.com/deepruby/chess/pull/9#discussion_r45652331","pull_request_url":"https://api.github.com/repos/deepruby/chess/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/deepruby/chess/pulls/comments/45652331"},"html":{"href":"https://github.com/deepruby/chess/pull/9#discussion_r45652331"},"pull_request":{"href":"https://api.github.com/repos/deepruby/chess/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/deepruby/chess/pulls/9","id":51535036,"html_url":"https://github.com/deepruby/chess/pull/9","diff_url":"https://github.com/deepruby/chess/pull/9.diff","patch_url":"https://github.com/deepruby/chess/pull/9.patch","issue_url":"https://api.github.com/repos/deepruby/chess/issues/9","number":9,"state":"open","locked":false,"title":"Populate board","user":{"login":"jamesfoster85","id":13140028,"avatar_url":"https://avatars.githubusercontent.com/u/13140028?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesfoster85","html_url":"https://github.com/jamesfoster85","followers_url":"https://api.github.com/users/jamesfoster85/followers","following_url":"https://api.github.com/users/jamesfoster85/following{/other_user}","gists_url":"https://api.github.com/users/jamesfoster85/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesfoster85/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesfoster85/subscriptions","organizations_url":"https://api.github.com/users/jamesfoster85/orgs","repos_url":"https://api.github.com/users/jamesfoster85/repos","events_url":"https://api.github.com/users/jamesfoster85/events{/privacy}","received_events_url":"https://api.github.com/users/jamesfoster85/received_events","type":"User","site_admin":false},"body":"- Authenticate user before new and create actions on games controller\r\n- Use a hidden field on the new game form to set current_user as white_player\r\n- Update strong params to permit white_player_id\r\n- After_create callback create the 32 pieces\r\n  - Assigns the first 16 pieces to white_player, the other 16 have player_id => nil\r\n","created_at":"2015-11-23T15:13:26Z","updated_at":"2015-11-23T19:57:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17ddbf6139320a829ca861b3b2289e503082b918","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/deepruby/chess/pulls/9/commits","review_comments_url":"https://api.github.com/repos/deepruby/chess/pulls/9/comments","review_comment_url":"https://api.github.com/repos/deepruby/chess/pulls/comments{/number}","comments_url":"https://api.github.com/repos/deepruby/chess/issues/9/comments","statuses_url":"https://api.github.com/repos/deepruby/chess/statuses/765d8217092f3f273bace04308d1a240643e58c2","head":{"label":"deepruby:populate-board","ref":"populate-board","sha":"765d8217092f3f273bace04308d1a240643e58c2","user":{"login":"deepruby","id":15810945,"avatar_url":"https://avatars.githubusercontent.com/u/15810945?v=3","gravatar_id":"","url":"https://api.github.com/users/deepruby","html_url":"https://github.com/deepruby","followers_url":"https://api.github.com/users/deepruby/followers","following_url":"https://api.github.com/users/deepruby/following{/other_user}","gists_url":"https://api.github.com/users/deepruby/gists{/gist_id}","starred_url":"https://api.github.com/users/deepruby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deepruby/subscriptions","organizations_url":"https://api.github.com/users/deepruby/orgs","repos_url":"https://api.github.com/users/deepruby/repos","events_url":"https://api.github.com/users/deepruby/events{/privacy}","received_events_url":"https://api.github.com/users/deepruby/received_events","type":"Organization","site_admin":false},"repo":{"id":46030724,"name":"chess","full_name":"deepruby/chess","owner":{"login":"deepruby","id":15810945,"avatar_url":"https://avatars.githubusercontent.com/u/15810945?v=3","gravatar_id":"","url":"https://api.github.com/users/deepruby","html_url":"https://github.com/deepruby","followers_url":"https://api.github.com/users/deepruby/followers","following_url":"https://api.github.com/users/deepruby/following{/other_user}","gists_url":"https://api.github.com/users/deepruby/gists{/gist_id}","starred_url":"https://api.github.com/users/deepruby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deepruby/subscriptions","organizations_url":"https://api.github.com/users/deepruby/orgs","repos_url":"https://api.github.com/users/deepruby/repos","events_url":"https://api.github.com/users/deepruby/events{/privacy}","received_events_url":"https://api.github.com/users/deepruby/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/deepruby/chess","description":"","fork":false,"url":"https://api.github.com/repos/deepruby/chess","forks_url":"https://api.github.com/repos/deepruby/chess/forks","keys_url":"https://api.github.com/repos/deepruby/chess/keys{/key_id}","collaborators_url":"https://api.github.com/repos/deepruby/chess/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/deepruby/chess/teams","hooks_url":"https://api.github.com/repos/deepruby/chess/hooks","issue_events_url":"https://api.github.com/repos/deepruby/chess/issues/events{/number}","events_url":"https://api.github.com/repos/deepruby/chess/events","assignees_url":"https://api.github.com/repos/deepruby/chess/assignees{/user}","branches_url":"https://api.github.com/repos/deepruby/chess/branches{/branch}","tags_url":"https://api.github.com/repos/deepruby/chess/tags","blobs_url":"https://api.github.com/repos/deepruby/chess/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/deepruby/chess/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/deepruby/chess/git/refs{/sha}","trees_url":"https://api.github.com/repos/deepruby/chess/git/trees{/sha}","statuses_url":"https://api.github.com/repos/deepruby/chess/statuses/{sha}","languages_url":"https://api.github.com/repos/deepruby/chess/languages","stargazers_url":"https://api.github.com/repos/deepruby/chess/stargazers","contributors_url":"https://api.github.com/repos/deepruby/chess/contributors","subscribers_url":"https://api.github.com/repos/deepruby/chess/subscribers","subscription_url":"https://api.github.com/repos/deepruby/chess/subscription","commits_url":"https://api.github.com/repos/deepruby/chess/commits{/sha}","git_commits_url":"https://api.github.com/repos/deepruby/chess/git/commits{/sha}","comments_url":"https://api.github.com/repos/deepruby/chess/comments{/number}","issue_comment_url":"https://api.github.com/repos/deepruby/chess/issues/comments{/number}","contents_url":"https://api.github.com/repos/deepruby/chess/contents/{+path}","compare_url":"https://api.github.com/repos/deepruby/chess/compare/{base}...{head}","merges_url":"https://api.github.com/repos/deepruby/chess/merges","archive_url":"https://api.github.com/repos/deepruby/chess/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/deepruby/chess/downloads","issues_url":"https://api.github.com/repos/deepruby/chess/issues{/number}","pulls_url":"https://api.github.com/repos/deepruby/chess/pulls{/number}","milestones_url":"https://api.github.com/repos/deepruby/chess/milestones{/number}","notifications_url":"https://api.github.com/repos/deepruby/chess/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/deepruby/chess/labels{/name}","releases_url":"https://api.github.com/repos/deepruby/chess/releases{/id}","created_at":"2015-11-12T05:06:14Z","updated_at":"2015-11-12T15:07:22Z","pushed_at":"2015-11-23T15:13:26Z","git_url":"git://github.com/deepruby/chess.git","ssh_url":"git@github.com:deepruby/chess.git","clone_url":"https://github.com/deepruby/chess.git","svn_url":"https://github.com/deepruby/chess","homepage":" http://chess-deep-ruby.herokuapp.com","size":99,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"deepruby:master","ref":"master","sha":"1c4b68a7a044fdf569e3725ba9bafaaede690785","user":{"login":"deepruby","id":15810945,"avatar_url":"https://avatars.githubusercontent.com/u/15810945?v=3","gravatar_id":"","url":"https://api.github.com/users/deepruby","html_url":"https://github.com/deepruby","followers_url":"https://api.github.com/users/deepruby/followers","following_url":"https://api.github.com/users/deepruby/following{/other_user}","gists_url":"https://api.github.com/users/deepruby/gists{/gist_id}","starred_url":"https://api.github.com/users/deepruby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deepruby/subscriptions","organizations_url":"https://api.github.com/users/deepruby/orgs","repos_url":"https://api.github.com/users/deepruby/repos","events_url":"https://api.github.com/users/deepruby/events{/privacy}","received_events_url":"https://api.github.com/users/deepruby/received_events","type":"Organization","site_admin":false},"repo":{"id":46030724,"name":"chess","full_name":"deepruby/chess","owner":{"login":"deepruby","id":15810945,"avatar_url":"https://avatars.githubusercontent.com/u/15810945?v=3","gravatar_id":"","url":"https://api.github.com/users/deepruby","html_url":"https://github.com/deepruby","followers_url":"https://api.github.com/users/deepruby/followers","following_url":"https://api.github.com/users/deepruby/following{/other_user}","gists_url":"https://api.github.com/users/deepruby/gists{/gist_id}","starred_url":"https://api.github.com/users/deepruby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deepruby/subscriptions","organizations_url":"https://api.github.com/users/deepruby/orgs","repos_url":"https://api.github.com/users/deepruby/repos","events_url":"https://api.github.com/users/deepruby/events{/privacy}","received_events_url":"https://api.github.com/users/deepruby/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/deepruby/chess","description":"","fork":false,"url":"https://api.github.com/repos/deepruby/chess","forks_url":"https://api.github.com/repos/deepruby/chess/forks","keys_url":"https://api.github.com/repos/deepruby/chess/keys{/key_id}","collaborators_url":"https://api.github.com/repos/deepruby/chess/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/deepruby/chess/teams","hooks_url":"https://api.github.com/repos/deepruby/chess/hooks","issue_events_url":"https://api.github.com/repos/deepruby/chess/issues/events{/number}","events_url":"https://api.github.com/repos/deepruby/chess/events","assignees_url":"https://api.github.com/repos/deepruby/chess/assignees{/user}","branches_url":"https://api.github.com/repos/deepruby/chess/branches{/branch}","tags_url":"https://api.github.com/repos/deepruby/chess/tags","blobs_url":"https://api.github.com/repos/deepruby/chess/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/deepruby/chess/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/deepruby/chess/git/refs{/sha}","trees_url":"https://api.github.com/repos/deepruby/chess/git/trees{/sha}","statuses_url":"https://api.github.com/repos/deepruby/chess/statuses/{sha}","languages_url":"https://api.github.com/repos/deepruby/chess/languages","stargazers_url":"https://api.github.com/repos/deepruby/chess/stargazers","contributors_url":"https://api.github.com/repos/deepruby/chess/contributors","subscribers_url":"https://api.github.com/repos/deepruby/chess/subscribers","subscription_url":"https://api.github.com/repos/deepruby/chess/subscription","commits_url":"https://api.github.com/repos/deepruby/chess/commits{/sha}","git_commits_url":"https://api.github.com/repos/deepruby/chess/git/commits{/sha}","comments_url":"https://api.github.com/repos/deepruby/chess/comments{/number}","issue_comment_url":"https://api.github.com/repos/deepruby/chess/issues/comments{/number}","contents_url":"https://api.github.com/repos/deepruby/chess/contents/{+path}","compare_url":"https://api.github.com/repos/deepruby/chess/compare/{base}...{head}","merges_url":"https://api.github.com/repos/deepruby/chess/merges","archive_url":"https://api.github.com/repos/deepruby/chess/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/deepruby/chess/downloads","issues_url":"https://api.github.com/repos/deepruby/chess/issues{/number}","pulls_url":"https://api.github.com/repos/deepruby/chess/pulls{/number}","milestones_url":"https://api.github.com/repos/deepruby/chess/milestones{/number}","notifications_url":"https://api.github.com/repos/deepruby/chess/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/deepruby/chess/labels{/name}","releases_url":"https://api.github.com/repos/deepruby/chess/releases{/id}","created_at":"2015-11-12T05:06:14Z","updated_at":"2015-11-12T15:07:22Z","pushed_at":"2015-11-23T15:13:26Z","git_url":"git://github.com/deepruby/chess.git","ssh_url":"git@github.com:deepruby/chess.git","clone_url":"https://github.com/deepruby/chess.git","svn_url":"https://github.com/deepruby/chess","homepage":" http://chess-deep-ruby.herokuapp.com","size":99,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/deepruby/chess/pulls/9"},"html":{"href":"https://github.com/deepruby/chess/pull/9"},"issue":{"href":"https://api.github.com/repos/deepruby/chess/issues/9"},"comments":{"href":"https://api.github.com/repos/deepruby/chess/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/deepruby/chess/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/deepruby/chess/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/deepruby/chess/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/deepruby/chess/statuses/765d8217092f3f273bace04308d1a240643e58c2"}}}}