{"action":"created","comment":{"url":"https://api.github.com/repos/queens-pawn/chess_app/pulls/comments/47002250","id":47002250,"diff_hunk":"@@ -1,4 +1,12 @@\n require 'test_helper'\n \n class PiecesControllerTest < ActionController::TestCase\n+  test \"should get update\" do\n+    piece = FactoryGirl.create(:piece)\n+    put :update, :id => piece.id, :piece => { :x_position => 2, :y_position => 1 }","path":"test/controllers/pieces_controller_test.rb","position":6,"original_position":6,"commit_id":"cb05654d2af4cc2414f5e34d3a87b3306102727d","original_commit_id":"cb05654d2af4cc2414f5e34d3a87b3306102727d","user":{"login":"KaoruDev","id":5273755,"avatar_url":"https://avatars.githubusercontent.com/u/5273755?v=3","gravatar_id":"","url":"https://api.github.com/users/KaoruDev","html_url":"https://github.com/KaoruDev","followers_url":"https://api.github.com/users/KaoruDev/followers","following_url":"https://api.github.com/users/KaoruDev/following{/other_user}","gists_url":"https://api.github.com/users/KaoruDev/gists{/gist_id}","starred_url":"https://api.github.com/users/KaoruDev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KaoruDev/subscriptions","organizations_url":"https://api.github.com/users/KaoruDev/orgs","repos_url":"https://api.github.com/users/KaoruDev/repos","events_url":"https://api.github.com/users/KaoruDev/events{/privacy}","received_events_url":"https://api.github.com/users/KaoruDev/received_events","type":"User","site_admin":false},"body":"right after this, add `piece.reload`\r\n\r\n**TLDR** ActiveRecord caches attributes on the ruby model object so that it doesn't have to keep asking the server for details. When we create send the request to update the record, the model ( ruby object ) and record (postgresql row) are out of sync. `reload` method updates the data in the model ( ruby object ).\r\n","created_at":"2015-12-08T19:38:25Z","updated_at":"2015-12-08T19:38:25Z","html_url":"https://github.com/queens-pawn/chess_app/pull/12#discussion_r47002250","pull_request_url":"https://api.github.com/repos/queens-pawn/chess_app/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/queens-pawn/chess_app/pulls/comments/47002250"},"html":{"href":"https://github.com/queens-pawn/chess_app/pull/12#discussion_r47002250"},"pull_request":{"href":"https://api.github.com/repos/queens-pawn/chess_app/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/queens-pawn/chess_app/pulls/12","id":52897788,"html_url":"https://github.com/queens-pawn/chess_app/pull/12","diff_url":"https://github.com/queens-pawn/chess_app/pull/12.diff","patch_url":"https://github.com/queens-pawn/chess_app/pull/12.patch","issue_url":"https://api.github.com/repos/queens-pawn/chess_app/issues/12","number":12,"state":"open","locked":false,"title":"Alan moving","user":{"login":"alan24","id":10982740,"avatar_url":"https://avatars.githubusercontent.com/u/10982740?v=3","gravatar_id":"","url":"https://api.github.com/users/alan24","html_url":"https://github.com/alan24","followers_url":"https://api.github.com/users/alan24/followers","following_url":"https://api.github.com/users/alan24/following{/other_user}","gists_url":"https://api.github.com/users/alan24/gists{/gist_id}","starred_url":"https://api.github.com/users/alan24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alan24/subscriptions","organizations_url":"https://api.github.com/users/alan24/orgs","repos_url":"https://api.github.com/users/alan24/repos","events_url":"https://api.github.com/users/alan24/events{/privacy}","received_events_url":"https://api.github.com/users/alan24/received_events","type":"User","site_admin":false},"body":"Still working on update piece test. ","created_at":"2015-12-07T20:41:15Z","updated_at":"2015-12-08T19:38:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e728efd43033adf8a42b176683c6f39145e7ecb8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/queens-pawn/chess_app/pulls/12/commits","review_comments_url":"https://api.github.com/repos/queens-pawn/chess_app/pulls/12/comments","review_comment_url":"https://api.github.com/repos/queens-pawn/chess_app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/queens-pawn/chess_app/issues/12/comments","statuses_url":"https://api.github.com/repos/queens-pawn/chess_app/statuses/cb05654d2af4cc2414f5e34d3a87b3306102727d","head":{"label":"queens-pawn:alan-moving","ref":"alan-moving","sha":"cb05654d2af4cc2414f5e34d3a87b3306102727d","user":{"login":"queens-pawn","id":15897549,"avatar_url":"https://avatars.githubusercontent.com/u/15897549?v=3","gravatar_id":"","url":"https://api.github.com/users/queens-pawn","html_url":"https://github.com/queens-pawn","followers_url":"https://api.github.com/users/queens-pawn/followers","following_url":"https://api.github.com/users/queens-pawn/following{/other_user}","gists_url":"https://api.github.com/users/queens-pawn/gists{/gist_id}","starred_url":"https://api.github.com/users/queens-pawn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/queens-pawn/subscriptions","organizations_url":"https://api.github.com/users/queens-pawn/orgs","repos_url":"https://api.github.com/users/queens-pawn/repos","events_url":"https://api.github.com/users/queens-pawn/events{/privacy}","received_events_url":"https://api.github.com/users/queens-pawn/received_events","type":"Organization","site_admin":false},"repo":{"id":46376589,"name":"chess_app","full_name":"queens-pawn/chess_app","owner":{"login":"queens-pawn","id":15897549,"avatar_url":"https://avatars.githubusercontent.com/u/15897549?v=3","gravatar_id":"","url":"https://api.github.com/users/queens-pawn","html_url":"https://github.com/queens-pawn","followers_url":"https://api.github.com/users/queens-pawn/followers","following_url":"https://api.github.com/users/queens-pawn/following{/other_user}","gists_url":"https://api.github.com/users/queens-pawn/gists{/gist_id}","starred_url":"https://api.github.com/users/queens-pawn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/queens-pawn/subscriptions","organizations_url":"https://api.github.com/users/queens-pawn/orgs","repos_url":"https://api.github.com/users/queens-pawn/repos","events_url":"https://api.github.com/users/queens-pawn/events{/privacy}","received_events_url":"https://api.github.com/users/queens-pawn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/queens-pawn/chess_app","description":"","fork":false,"url":"https://api.github.com/repos/queens-pawn/chess_app","forks_url":"https://api.github.com/repos/queens-pawn/chess_app/forks","keys_url":"https://api.github.com/repos/queens-pawn/chess_app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/queens-pawn/chess_app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/queens-pawn/chess_app/teams","hooks_url":"https://api.github.com/repos/queens-pawn/chess_app/hooks","issue_events_url":"https://api.github.com/repos/queens-pawn/chess_app/issues/events{/number}","events_url":"https://api.github.com/repos/queens-pawn/chess_app/events","assignees_url":"https://api.github.com/repos/queens-pawn/chess_app/assignees{/user}","branches_url":"https://api.github.com/repos/queens-pawn/chess_app/branches{/branch}","tags_url":"https://api.github.com/repos/queens-pawn/chess_app/tags","blobs_url":"https://api.github.com/repos/queens-pawn/chess_app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/queens-pawn/chess_app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/queens-pawn/chess_app/git/refs{/sha}","trees_url":"https://api.github.com/repos/queens-pawn/chess_app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/queens-pawn/chess_app/statuses/{sha}","languages_url":"https://api.github.com/repos/queens-pawn/chess_app/languages","stargazers_url":"https://api.github.com/repos/queens-pawn/chess_app/stargazers","contributors_url":"https://api.github.com/repos/queens-pawn/chess_app/contributors","subscribers_url":"https://api.github.com/repos/queens-pawn/chess_app/subscribers","subscription_url":"https://api.github.com/repos/queens-pawn/chess_app/subscription","commits_url":"https://api.github.com/repos/queens-pawn/chess_app/commits{/sha}","git_commits_url":"https://api.github.com/repos/queens-pawn/chess_app/git/commits{/sha}","comments_url":"https://api.github.com/repos/queens-pawn/chess_app/comments{/number}","issue_comment_url":"https://api.github.com/repos/queens-pawn/chess_app/issues/comments{/number}","contents_url":"https://api.github.com/repos/queens-pawn/chess_app/contents/{+path}","compare_url":"https://api.github.com/repos/queens-pawn/chess_app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/queens-pawn/chess_app/merges","archive_url":"https://api.github.com/repos/queens-pawn/chess_app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/queens-pawn/chess_app/downloads","issues_url":"https://api.github.com/repos/queens-pawn/chess_app/issues{/number}","pulls_url":"https://api.github.com/repos/queens-pawn/chess_app/pulls{/number}","milestones_url":"https://api.github.com/repos/queens-pawn/chess_app/milestones{/number}","notifications_url":"https://api.github.com/repos/queens-pawn/chess_app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/queens-pawn/chess_app/labels{/name}","releases_url":"https://api.github.com/repos/queens-pawn/chess_app/releases{/id}","created_at":"2015-11-17T21:28:22Z","updated_at":"2015-11-17T21:41:07Z","pushed_at":"2015-12-08T18:58:36Z","git_url":"git://github.com/queens-pawn/chess_app.git","ssh_url":"git@github.com:queens-pawn/chess_app.git","clone_url":"https://github.com/queens-pawn/chess_app.git","svn_url":"https://github.com/queens-pawn/chess_app","homepage":null,"size":136,"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":"queens-pawn:master","ref":"master","sha":"0dbda794e2072bd0a420e2d5a790941a413b067d","user":{"login":"queens-pawn","id":15897549,"avatar_url":"https://avatars.githubusercontent.com/u/15897549?v=3","gravatar_id":"","url":"https://api.github.com/users/queens-pawn","html_url":"https://github.com/queens-pawn","followers_url":"https://api.github.com/users/queens-pawn/followers","following_url":"https://api.github.com/users/queens-pawn/following{/other_user}","gists_url":"https://api.github.com/users/queens-pawn/gists{/gist_id}","starred_url":"https://api.github.com/users/queens-pawn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/queens-pawn/subscriptions","organizations_url":"https://api.github.com/users/queens-pawn/orgs","repos_url":"https://api.github.com/users/queens-pawn/repos","events_url":"https://api.github.com/users/queens-pawn/events{/privacy}","received_events_url":"https://api.github.com/users/queens-pawn/received_events","type":"Organization","site_admin":false},"repo":{"id":46376589,"name":"chess_app","full_name":"queens-pawn/chess_app","owner":{"login":"queens-pawn","id":15897549,"avatar_url":"https://avatars.githubusercontent.com/u/15897549?v=3","gravatar_id":"","url":"https://api.github.com/users/queens-pawn","html_url":"https://github.com/queens-pawn","followers_url":"https://api.github.com/users/queens-pawn/followers","following_url":"https://api.github.com/users/queens-pawn/following{/other_user}","gists_url":"https://api.github.com/users/queens-pawn/gists{/gist_id}","starred_url":"https://api.github.com/users/queens-pawn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/queens-pawn/subscriptions","organizations_url":"https://api.github.com/users/queens-pawn/orgs","repos_url":"https://api.github.com/users/queens-pawn/repos","events_url":"https://api.github.com/users/queens-pawn/events{/privacy}","received_events_url":"https://api.github.com/users/queens-pawn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/queens-pawn/chess_app","description":"","fork":false,"url":"https://api.github.com/repos/queens-pawn/chess_app","forks_url":"https://api.github.com/repos/queens-pawn/chess_app/forks","keys_url":"https://api.github.com/repos/queens-pawn/chess_app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/queens-pawn/chess_app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/queens-pawn/chess_app/teams","hooks_url":"https://api.github.com/repos/queens-pawn/chess_app/hooks","issue_events_url":"https://api.github.com/repos/queens-pawn/chess_app/issues/events{/number}","events_url":"https://api.github.com/repos/queens-pawn/chess_app/events","assignees_url":"https://api.github.com/repos/queens-pawn/chess_app/assignees{/user}","branches_url":"https://api.github.com/repos/queens-pawn/chess_app/branches{/branch}","tags_url":"https://api.github.com/repos/queens-pawn/chess_app/tags","blobs_url":"https://api.github.com/repos/queens-pawn/chess_app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/queens-pawn/chess_app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/queens-pawn/chess_app/git/refs{/sha}","trees_url":"https://api.github.com/repos/queens-pawn/chess_app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/queens-pawn/chess_app/statuses/{sha}","languages_url":"https://api.github.com/repos/queens-pawn/chess_app/languages","stargazers_url":"https://api.github.com/repos/queens-pawn/chess_app/stargazers","contributors_url":"https://api.github.com/repos/queens-pawn/chess_app/contributors","subscribers_url":"https://api.github.com/repos/queens-pawn/chess_app/subscribers","subscription_url":"https://api.github.com/repos/queens-pawn/chess_app/subscription","commits_url":"https://api.github.com/repos/queens-pawn/chess_app/commits{/sha}","git_commits_url":"https://api.github.com/repos/queens-pawn/chess_app/git/commits{/sha}","comments_url":"https://api.github.com/repos/queens-pawn/chess_app/comments{/number}","issue_comment_url":"https://api.github.com/repos/queens-pawn/chess_app/issues/comments{/number}","contents_url":"https://api.github.com/repos/queens-pawn/chess_app/contents/{+path}","compare_url":"https://api.github.com/repos/queens-pawn/chess_app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/queens-pawn/chess_app/merges","archive_url":"https://api.github.com/repos/queens-pawn/chess_app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/queens-pawn/chess_app/downloads","issues_url":"https://api.github.com/repos/queens-pawn/chess_app/issues{/number}","pulls_url":"https://api.github.com/repos/queens-pawn/chess_app/pulls{/number}","milestones_url":"https://api.github.com/repos/queens-pawn/chess_app/milestones{/number}","notifications_url":"https://api.github.com/repos/queens-pawn/chess_app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/queens-pawn/chess_app/labels{/name}","releases_url":"https://api.github.com/repos/queens-pawn/chess_app/releases{/id}","created_at":"2015-11-17T21:28:22Z","updated_at":"2015-11-17T21:41:07Z","pushed_at":"2015-12-08T18:58:36Z","git_url":"git://github.com/queens-pawn/chess_app.git","ssh_url":"git@github.com:queens-pawn/chess_app.git","clone_url":"https://github.com/queens-pawn/chess_app.git","svn_url":"https://github.com/queens-pawn/chess_app","homepage":null,"size":136,"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/queens-pawn/chess_app/pulls/12"},"html":{"href":"https://github.com/queens-pawn/chess_app/pull/12"},"issue":{"href":"https://api.github.com/repos/queens-pawn/chess_app/issues/12"},"comments":{"href":"https://api.github.com/repos/queens-pawn/chess_app/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/queens-pawn/chess_app/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/queens-pawn/chess_app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/queens-pawn/chess_app/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/queens-pawn/chess_app/statuses/cb05654d2af4cc2414f5e34d3a87b3306102727d"}}}}