{"action":"created","comment":{"url":"https://api.github.com/repos/rails/rails/pulls/comments/59319396","id":59319396,"diff_hunk":"@@ -180,7 +180,7 @@ def attribute_changed?(attr, options = nil) #:nodoc:\n         result &&= options[:to] == __send__(attr) if options.key?(:to)\n         result &&= options[:from] == changed_attributes[attr] if options.key?(:from)\n       end\n-      result\n+      !!result","path":"activemodel/lib/active_model/dirty.rb","position":5,"original_position":5,"commit_id":"051d859880dde2896cc5417844e566569466b28c","original_commit_id":"051d859880dde2896cc5417844e566569466b28c","user":{"login":"Sen-Zhang","id":6109217,"avatar_url":"https://avatars.githubusercontent.com/u/6109217?v=3","gravatar_id":"","url":"https://api.github.com/users/Sen-Zhang","html_url":"https://github.com/Sen-Zhang","followers_url":"https://api.github.com/users/Sen-Zhang/followers","following_url":"https://api.github.com/users/Sen-Zhang/following{/other_user}","gists_url":"https://api.github.com/users/Sen-Zhang/gists{/gist_id}","starred_url":"https://api.github.com/users/Sen-Zhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sen-Zhang/subscriptions","organizations_url":"https://api.github.com/users/Sen-Zhang/orgs","repos_url":"https://api.github.com/users/Sen-Zhang/repos","events_url":"https://api.github.com/users/Sen-Zhang/events{/privacy}","received_events_url":"https://api.github.com/users/Sen-Zhang/received_events","type":"User","site_admin":false},"body":"@jeremy The change is trying to fix this issue https://github.com/rails/rails/issues/24220. The issue is caused by the fact that method `attribute_changed?` could return nil. I have proposed a more comprehensive fix https://github.com/rails/rails/pull/24242, but it has been considered going too far because some changes are not desired. I also tried to fix it by using `result.present?`, but this solution is also not preferable(@pixeltrix left some comments here for that https://github.com/rails/rails/pull/24242).","created_at":"2016-04-12T04:28:46Z","updated_at":"2016-04-12T04:28:46Z","html_url":"https://github.com/rails/rails/pull/24515#discussion_r59319396","pull_request_url":"https://api.github.com/repos/rails/rails/pulls/24515","_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/comments/59319396"},"html":{"href":"https://github.com/rails/rails/pull/24515#discussion_r59319396"},"pull_request":{"href":"https://api.github.com/repos/rails/rails/pulls/24515"}}},"pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/24515","id":66092609,"html_url":"https://github.com/rails/rails/pull/24515","diff_url":"https://github.com/rails/rails/pull/24515.diff","patch_url":"https://github.com/rails/rails/pull/24515.patch","issue_url":"https://api.github.com/repos/rails/rails/issues/24515","number":24515,"state":"open","locked":false,"title":"prevent 'attribute_changed?' from returning nil","user":{"login":"Sen-Zhang","id":6109217,"avatar_url":"https://avatars.githubusercontent.com/u/6109217?v=3","gravatar_id":"","url":"https://api.github.com/users/Sen-Zhang","html_url":"https://github.com/Sen-Zhang","followers_url":"https://api.github.com/users/Sen-Zhang/followers","following_url":"https://api.github.com/users/Sen-Zhang/following{/other_user}","gists_url":"https://api.github.com/users/Sen-Zhang/gists{/gist_id}","starred_url":"https://api.github.com/users/Sen-Zhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sen-Zhang/subscriptions","organizations_url":"https://api.github.com/users/Sen-Zhang/orgs","repos_url":"https://api.github.com/users/Sen-Zhang/repos","events_url":"https://api.github.com/users/Sen-Zhang/events{/privacy}","received_events_url":"https://api.github.com/users/Sen-Zhang/received_events","type":"User","site_admin":false},"body":"a simple attempt fix for https://github.com/rails/rails/issues/24220","created_at":"2016-04-12T02:36:22Z","updated_at":"2016-04-12T04:28:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4cf31da5b8e27cdcfd4482c4e91d452afa99b65a","assignee":{"login":"pixeltrix","id":6321,"avatar_url":"https://avatars.githubusercontent.com/u/6321?v=3","gravatar_id":"","url":"https://api.github.com/users/pixeltrix","html_url":"https://github.com/pixeltrix","followers_url":"https://api.github.com/users/pixeltrix/followers","following_url":"https://api.github.com/users/pixeltrix/following{/other_user}","gists_url":"https://api.github.com/users/pixeltrix/gists{/gist_id}","starred_url":"https://api.github.com/users/pixeltrix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pixeltrix/subscriptions","organizations_url":"https://api.github.com/users/pixeltrix/orgs","repos_url":"https://api.github.com/users/pixeltrix/repos","events_url":"https://api.github.com/users/pixeltrix/events{/privacy}","received_events_url":"https://api.github.com/users/pixeltrix/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/rails/rails/pulls/24515/commits","review_comments_url":"https://api.github.com/repos/rails/rails/pulls/24515/comments","review_comment_url":"https://api.github.com/repos/rails/rails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rails/rails/issues/24515/comments","statuses_url":"https://api.github.com/repos/rails/rails/statuses/051d859880dde2896cc5417844e566569466b28c","head":{"label":"Sen-Zhang:attribute_changed_not_return_nil","ref":"attribute_changed_not_return_nil","sha":"051d859880dde2896cc5417844e566569466b28c","user":{"login":"Sen-Zhang","id":6109217,"avatar_url":"https://avatars.githubusercontent.com/u/6109217?v=3","gravatar_id":"","url":"https://api.github.com/users/Sen-Zhang","html_url":"https://github.com/Sen-Zhang","followers_url":"https://api.github.com/users/Sen-Zhang/followers","following_url":"https://api.github.com/users/Sen-Zhang/following{/other_user}","gists_url":"https://api.github.com/users/Sen-Zhang/gists{/gist_id}","starred_url":"https://api.github.com/users/Sen-Zhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sen-Zhang/subscriptions","organizations_url":"https://api.github.com/users/Sen-Zhang/orgs","repos_url":"https://api.github.com/users/Sen-Zhang/repos","events_url":"https://api.github.com/users/Sen-Zhang/events{/privacy}","received_events_url":"https://api.github.com/users/Sen-Zhang/received_events","type":"User","site_admin":false},"repo":{"id":53708211,"name":"rails","full_name":"Sen-Zhang/rails","owner":{"login":"Sen-Zhang","id":6109217,"avatar_url":"https://avatars.githubusercontent.com/u/6109217?v=3","gravatar_id":"","url":"https://api.github.com/users/Sen-Zhang","html_url":"https://github.com/Sen-Zhang","followers_url":"https://api.github.com/users/Sen-Zhang/followers","following_url":"https://api.github.com/users/Sen-Zhang/following{/other_user}","gists_url":"https://api.github.com/users/Sen-Zhang/gists{/gist_id}","starred_url":"https://api.github.com/users/Sen-Zhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sen-Zhang/subscriptions","organizations_url":"https://api.github.com/users/Sen-Zhang/orgs","repos_url":"https://api.github.com/users/Sen-Zhang/repos","events_url":"https://api.github.com/users/Sen-Zhang/events{/privacy}","received_events_url":"https://api.github.com/users/Sen-Zhang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Sen-Zhang/rails","description":"Ruby on Rails","fork":true,"url":"https://api.github.com/repos/Sen-Zhang/rails","forks_url":"https://api.github.com/repos/Sen-Zhang/rails/forks","keys_url":"https://api.github.com/repos/Sen-Zhang/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Sen-Zhang/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Sen-Zhang/rails/teams","hooks_url":"https://api.github.com/repos/Sen-Zhang/rails/hooks","issue_events_url":"https://api.github.com/repos/Sen-Zhang/rails/issues/events{/number}","events_url":"https://api.github.com/repos/Sen-Zhang/rails/events","assignees_url":"https://api.github.com/repos/Sen-Zhang/rails/assignees{/user}","branches_url":"https://api.github.com/repos/Sen-Zhang/rails/branches{/branch}","tags_url":"https://api.github.com/repos/Sen-Zhang/rails/tags","blobs_url":"https://api.github.com/repos/Sen-Zhang/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Sen-Zhang/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Sen-Zhang/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/Sen-Zhang/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Sen-Zhang/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/Sen-Zhang/rails/languages","stargazers_url":"https://api.github.com/repos/Sen-Zhang/rails/stargazers","contributors_url":"https://api.github.com/repos/Sen-Zhang/rails/contributors","subscribers_url":"https://api.github.com/repos/Sen-Zhang/rails/subscribers","subscription_url":"https://api.github.com/repos/Sen-Zhang/rails/subscription","commits_url":"https://api.github.com/repos/Sen-Zhang/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/Sen-Zhang/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/Sen-Zhang/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/Sen-Zhang/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/Sen-Zhang/rails/contents/{+path}","compare_url":"https://api.github.com/repos/Sen-Zhang/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Sen-Zhang/rails/merges","archive_url":"https://api.github.com/repos/Sen-Zhang/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Sen-Zhang/rails/downloads","issues_url":"https://api.github.com/repos/Sen-Zhang/rails/issues{/number}","pulls_url":"https://api.github.com/repos/Sen-Zhang/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/Sen-Zhang/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/Sen-Zhang/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Sen-Zhang/rails/labels{/name}","releases_url":"https://api.github.com/repos/Sen-Zhang/rails/releases{/id}","deployments_url":"https://api.github.com/repos/Sen-Zhang/rails/deployments","created_at":"2016-03-12T01:56:42Z","updated_at":"2016-03-12T01:57:48Z","pushed_at":"2016-04-12T02:34:15Z","git_url":"git://github.com/Sen-Zhang/rails.git","ssh_url":"git@github.com:Sen-Zhang/rails.git","clone_url":"https://github.com/Sen-Zhang/rails.git","svn_url":"https://github.com/Sen-Zhang/rails","homepage":"http://rubyonrails.org","size":129787,"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":"db9bc8097399aab9c866175b12e9e099b6c83ffa","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}","deployments_url":"https://api.github.com/repos/rails/rails/deployments","created_at":"2008-04-11T02:19:47Z","updated_at":"2016-04-12T03:11:06Z","pushed_at":"2016-04-12T02:36:22Z","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":331182,"stargazers_count":30580,"watchers_count":30580,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":12422,"mirror_url":null,"open_issues_count":931,"forks":12422,"open_issues":931,"watchers":30580,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/24515"},"html":{"href":"https://github.com/rails/rails/pull/24515"},"issue":{"href":"https://api.github.com/repos/rails/rails/issues/24515"},"comments":{"href":"https://api.github.com/repos/rails/rails/issues/24515/comments"},"review_comments":{"href":"https://api.github.com/repos/rails/rails/pulls/24515/comments"},"review_comment":{"href":"https://api.github.com/repos/rails/rails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rails/rails/pulls/24515/commits"},"statuses":{"href":"https://api.github.com/repos/rails/rails/statuses/051d859880dde2896cc5417844e566569466b28c"}}}}