{"action":"created","comment":{"url":"https://api.github.com/repos/rails/rails/pulls/comments/24295808","id":24295808,"diff_hunk":"@@ -949,6 +950,18 @@ def test_reflect_the_most_recent_change\n     assert_equal post.author_id, author2.id\n   end\n \n+  def test_change_reference_id_should_change_reference\n+    course1 = Course.create!(:name => 'Course 1')\n+    course2 = Course.create!(:name => 'Course 2')\n+    entrant = Entrant.create!(:course => course1, :name => 'Entrant')\n+\n+    founded_entrant = course1.entrants.find entrant.id\n+    founded_entrant.course_id = course2.id\n+\n+    assert_equal course2.id, founded_entrant.course_id\n+    assert_equal course2.id, founded_entrant.course.id","path":"activerecord/test/cases/associations/belongs_to_associations_test.rb","position":21,"original_position":21,"commit_id":"bc82c69cdbcf8973639495f5e485db210467461f","original_commit_id":"bc82c69cdbcf8973639495f5e485db210467461f","user":{"login":"hundredwatt","id":91577,"avatar_url":"https://avatars.githubusercontent.com/u/91577?v=3","gravatar_id":"","url":"https://api.github.com/users/hundredwatt","html_url":"https://github.com/hundredwatt","followers_url":"https://api.github.com/users/hundredwatt/followers","following_url":"https://api.github.com/users/hundredwatt/following{/other_user}","gists_url":"https://api.github.com/users/hundredwatt/gists{/gist_id}","starred_url":"https://api.github.com/users/hundredwatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hundredwatt/subscriptions","organizations_url":"https://api.github.com/users/hundredwatt/orgs","repos_url":"https://api.github.com/users/hundredwatt/repos","events_url":"https://api.github.com/users/hundredwatt/events{/privacy}","received_events_url":"https://api.github.com/users/hundredwatt/received_events","type":"User","site_admin":false},"body":"@GCorbel duplicate line?","created_at":"2015-02-08T04:35:17Z","updated_at":"2015-02-08T04:35:17Z","html_url":"https://github.com/rails/rails/pull/18793#discussion_r24295808","pull_request_url":"https://api.github.com/repos/rails/rails/pulls/18793","_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/comments/24295808"},"html":{"href":"https://github.com/rails/rails/pull/18793#discussion_r24295808"},"pull_request":{"href":"https://api.github.com/repos/rails/rails/pulls/18793"}}},"pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/18793","id":28521090,"html_url":"https://github.com/rails/rails/pull/18793","diff_url":"https://github.com/rails/rails/pull/18793.diff","patch_url":"https://github.com/rails/rails/pull/18793.patch","issue_url":"https://api.github.com/repos/rails/rails/issues/18793","number":18793,"state":"open","locked":false,"title":"Reload the reference when the reference id is assigned","user":{"login":"GCorbel","id":1296201,"avatar_url":"https://avatars.githubusercontent.com/u/1296201?v=3","gravatar_id":"","url":"https://api.github.com/users/GCorbel","html_url":"https://github.com/GCorbel","followers_url":"https://api.github.com/users/GCorbel/followers","following_url":"https://api.github.com/users/GCorbel/following{/other_user}","gists_url":"https://api.github.com/users/GCorbel/gists{/gist_id}","starred_url":"https://api.github.com/users/GCorbel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GCorbel/subscriptions","organizations_url":"https://api.github.com/users/GCorbel/orgs","repos_url":"https://api.github.com/users/GCorbel/repos","events_url":"https://api.github.com/users/GCorbel/events{/privacy}","received_events_url":"https://api.github.com/users/GCorbel/received_events","type":"User","site_admin":false},"body":"Example:\r\n\r\n    comment = Comment.create!(:post => post1)\r\n\r\n    found_comment = post1.comments.find comment.id\r\n    found_comment.post_id = post2.id\r\n\r\n    assert_equal post2.id, found_comment.post.id # no longer fails\r\n\r\nFixes #18633.","created_at":"2015-02-03T02:08:53Z","updated_at":"2015-02-08T04:35:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0e213b767d82e6e11e7823b154a229e7dfe94fda","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rails/rails/pulls/18793/commits","review_comments_url":"https://api.github.com/repos/rails/rails/pulls/18793/comments","review_comment_url":"https://api.github.com/repos/rails/rails/pulls/comments/{number}","comments_url":"https://api.github.com/repos/rails/rails/issues/18793/comments","statuses_url":"https://api.github.com/repos/rails/rails/statuses/bc82c69cdbcf8973639495f5e485db210467461f","head":{"label":"GCorbel:master","ref":"master","sha":"bc82c69cdbcf8973639495f5e485db210467461f","user":{"login":"GCorbel","id":1296201,"avatar_url":"https://avatars.githubusercontent.com/u/1296201?v=3","gravatar_id":"","url":"https://api.github.com/users/GCorbel","html_url":"https://github.com/GCorbel","followers_url":"https://api.github.com/users/GCorbel/followers","following_url":"https://api.github.com/users/GCorbel/following{/other_user}","gists_url":"https://api.github.com/users/GCorbel/gists{/gist_id}","starred_url":"https://api.github.com/users/GCorbel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GCorbel/subscriptions","organizations_url":"https://api.github.com/users/GCorbel/orgs","repos_url":"https://api.github.com/users/GCorbel/repos","events_url":"https://api.github.com/users/GCorbel/events{/privacy}","received_events_url":"https://api.github.com/users/GCorbel/received_events","type":"User","site_admin":false},"repo":{"id":5103427,"name":"rails","full_name":"GCorbel/rails","owner":{"login":"GCorbel","id":1296201,"avatar_url":"https://avatars.githubusercontent.com/u/1296201?v=3","gravatar_id":"","url":"https://api.github.com/users/GCorbel","html_url":"https://github.com/GCorbel","followers_url":"https://api.github.com/users/GCorbel/followers","following_url":"https://api.github.com/users/GCorbel/following{/other_user}","gists_url":"https://api.github.com/users/GCorbel/gists{/gist_id}","starred_url":"https://api.github.com/users/GCorbel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GCorbel/subscriptions","organizations_url":"https://api.github.com/users/GCorbel/orgs","repos_url":"https://api.github.com/users/GCorbel/repos","events_url":"https://api.github.com/users/GCorbel/events{/privacy}","received_events_url":"https://api.github.com/users/GCorbel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/GCorbel/rails","description":"Ruby on Rails","fork":true,"url":"https://api.github.com/repos/GCorbel/rails","forks_url":"https://api.github.com/repos/GCorbel/rails/forks","keys_url":"https://api.github.com/repos/GCorbel/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GCorbel/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GCorbel/rails/teams","hooks_url":"https://api.github.com/repos/GCorbel/rails/hooks","issue_events_url":"https://api.github.com/repos/GCorbel/rails/issues/events{/number}","events_url":"https://api.github.com/repos/GCorbel/rails/events","assignees_url":"https://api.github.com/repos/GCorbel/rails/assignees{/user}","branches_url":"https://api.github.com/repos/GCorbel/rails/branches{/branch}","tags_url":"https://api.github.com/repos/GCorbel/rails/tags","blobs_url":"https://api.github.com/repos/GCorbel/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GCorbel/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GCorbel/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/GCorbel/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GCorbel/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/GCorbel/rails/languages","stargazers_url":"https://api.github.com/repos/GCorbel/rails/stargazers","contributors_url":"https://api.github.com/repos/GCorbel/rails/contributors","subscribers_url":"https://api.github.com/repos/GCorbel/rails/subscribers","subscription_url":"https://api.github.com/repos/GCorbel/rails/subscription","commits_url":"https://api.github.com/repos/GCorbel/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/GCorbel/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/GCorbel/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/GCorbel/rails/issues/comments/{number}","contents_url":"https://api.github.com/repos/GCorbel/rails/contents/{+path}","compare_url":"https://api.github.com/repos/GCorbel/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GCorbel/rails/merges","archive_url":"https://api.github.com/repos/GCorbel/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GCorbel/rails/downloads","issues_url":"https://api.github.com/repos/GCorbel/rails/issues{/number}","pulls_url":"https://api.github.com/repos/GCorbel/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/GCorbel/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/GCorbel/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GCorbel/rails/labels{/name}","releases_url":"https://api.github.com/repos/GCorbel/rails/releases{/id}","created_at":"2012-07-18T23:57:57Z","updated_at":"2015-02-03T02:02:06Z","pushed_at":"2015-02-03T02:02:02Z","git_url":"git://github.com/GCorbel/rails.git","ssh_url":"git@github.com:GCorbel/rails.git","clone_url":"https://github.com/GCorbel/rails.git","svn_url":"https://github.com/GCorbel/rails","homepage":"http://rubyonrails.org","size":116462,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"rails:master","ref":"master","sha":"186418724c6da41caeb0fd304894bcfcc154b8bb","user":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"repo":{"id":8514,"name":"rails","full_name":"rails/rails","owner":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rails/rails","description":"Ruby on Rails","fork":false,"url":"https://api.github.com/repos/rails/rails","forks_url":"https://api.github.com/repos/rails/rails/forks","keys_url":"https://api.github.com/repos/rails/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rails/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rails/rails/teams","hooks_url":"https://api.github.com/repos/rails/rails/hooks","issue_events_url":"https://api.github.com/repos/rails/rails/issues/events{/number}","events_url":"https://api.github.com/repos/rails/rails/events","assignees_url":"https://api.github.com/repos/rails/rails/assignees{/user}","branches_url":"https://api.github.com/repos/rails/rails/branches{/branch}","tags_url":"https://api.github.com/repos/rails/rails/tags","blobs_url":"https://api.github.com/repos/rails/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rails/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rails/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/rails/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rails/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/rails/rails/languages","stargazers_url":"https://api.github.com/repos/rails/rails/stargazers","contributors_url":"https://api.github.com/repos/rails/rails/contributors","subscribers_url":"https://api.github.com/repos/rails/rails/subscribers","subscription_url":"https://api.github.com/repos/rails/rails/subscription","commits_url":"https://api.github.com/repos/rails/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/rails/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/rails/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/rails/rails/issues/comments/{number}","contents_url":"https://api.github.com/repos/rails/rails/contents/{+path}","compare_url":"https://api.github.com/repos/rails/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rails/rails/merges","archive_url":"https://api.github.com/repos/rails/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rails/rails/downloads","issues_url":"https://api.github.com/repos/rails/rails/issues{/number}","pulls_url":"https://api.github.com/repos/rails/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/rails/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/rails/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rails/rails/labels{/name}","releases_url":"https://api.github.com/repos/rails/rails/releases{/id}","created_at":"2008-04-11T02:19:47Z","updated_at":"2015-02-08T01:09:21Z","pushed_at":"2015-02-08T00:51:26Z","git_url":"git://github.com/rails/rails.git","ssh_url":"git@github.com:rails/rails.git","clone_url":"https://github.com/rails/rails.git","svn_url":"https://github.com/rails/rails","homepage":"http://rubyonrails.org","size":370479,"stargazers_count":24849,"watchers_count":24849,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9671,"mirror_url":null,"open_issues_count":750,"forks":9671,"open_issues":750,"watchers":24849,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/18793"},"html":{"href":"https://github.com/rails/rails/pull/18793"},"issue":{"href":"https://api.github.com/repos/rails/rails/issues/18793"},"comments":{"href":"https://api.github.com/repos/rails/rails/issues/18793/comments"},"review_comments":{"href":"https://api.github.com/repos/rails/rails/pulls/18793/comments"},"review_comment":{"href":"https://api.github.com/repos/rails/rails/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/rails/rails/pulls/18793/commits"},"statuses":{"href":"https://api.github.com/repos/rails/rails/statuses/bc82c69cdbcf8973639495f5e485db210467461f"}}}}