{"action":"created","comment":{"url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/pulls/comments/119663957","pull_request_review_id":41564903,"id":119663957,"diff_hunk":"@@ -2177,10 +2177,20 @@ protected function _setFieldValue($field, $value)\n \n         if ($forceDirty || !array_key_exists($columnName, $this->_record) || $this->_record[$columnName] !== $value) {\n             if (array_key_exists($columnName, $this->_record)) {\n-                $this->_originalValues[$field] = $originalValue;\n+                // only store original value if it hasn't been previously set\n+                if (!array_key_exists($field, $this->_originalValues)) {\n+                    $this->_originalValues[$field] = $originalValue;\n+                } elseif ($this->_originalValues[$field] == $value) { // the value was reverted back to it's original value\n+                    unset($this->_originalValues[$field]);\n+                }\n             }\n             $this->_record[$columnName] = $value;\n-            $this->_isDirty = true;\n+            // set record dirty if there are still dirty fields remaining","path":"php-classes/ActiveRecord.class.php","position":14,"original_position":14,"commit_id":"269bdfd138c510a9d6c3d48d68bf4d659e29a103","original_commit_id":"269bdfd138c510a9d6c3d48d68bf4d659e29a103","user":{"login":"nbey","id":984849,"avatar_url":"https://avatars0.githubusercontent.com/u/984849?v=3","gravatar_id":"","url":"https://api.github.com/users/nbey","html_url":"https://github.com/nbey","followers_url":"https://api.github.com/users/nbey/followers","following_url":"https://api.github.com/users/nbey/following{/other_user}","gists_url":"https://api.github.com/users/nbey/gists{/gist_id}","starred_url":"https://api.github.com/users/nbey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbey/subscriptions","organizations_url":"https://api.github.com/users/nbey/orgs","repos_url":"https://api.github.com/users/nbey/repos","events_url":"https://api.github.com/users/nbey/events{/privacy}","received_events_url":"https://api.github.com/users/nbey/received_events","type":"User","site_admin":false},"body":"My mistake, I misread that. I thought you said set `$Record->isDirty`, not `$Record->_isDirty` to that expression","created_at":"2017-06-01T16:30:11Z","updated_at":"2017-06-01T16:30:12Z","html_url":"https://github.com/JarvusInnovations/emergence-skeleton/pull/133#discussion_r119663957","pull_request_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/pulls/133","_links":{"self":{"href":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/pulls/comments/119663957"},"html":{"href":"https://github.com/JarvusInnovations/emergence-skeleton/pull/133#discussion_r119663957"},"pull_request":{"href":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/pulls/133"}}},"pull_request":{"url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/pulls/133","id":122735441,"html_url":"https://github.com/JarvusInnovations/emergence-skeleton/pull/133","diff_url":"https://github.com/JarvusInnovations/emergence-skeleton/pull/133.diff","patch_url":"https://github.com/JarvusInnovations/emergence-skeleton/pull/133.patch","issue_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/issues/133","number":133,"state":"open","locked":false,"title":"Update ActiveRecord 'dirty' logic","user":{"login":"nbey","id":984849,"avatar_url":"https://avatars0.githubusercontent.com/u/984849?v=3","gravatar_id":"","url":"https://api.github.com/users/nbey","html_url":"https://github.com/nbey","followers_url":"https://api.github.com/users/nbey/followers","following_url":"https://api.github.com/users/nbey/following{/other_user}","gists_url":"https://api.github.com/users/nbey/gists{/gist_id}","starred_url":"https://api.github.com/users/nbey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbey/subscriptions","organizations_url":"https://api.github.com/users/nbey/orgs","repos_url":"https://api.github.com/users/nbey/repos","events_url":"https://api.github.com/users/nbey/events{/privacy}","received_events_url":"https://api.github.com/users/nbey/received_events","type":"User","site_admin":false},"body":"- Only store original value once\r\n- Unset original value on reverted fields\r\n- Remove record dirtyness if the only modified field is\r\nreverted back to its original value\r\n- When updating relationships, only set record dirty when\r\nmodifying `one-many` & `context-children` relationships.\r\nOther relationship types will modify the record\r\nand internally call `_setFieldValue()` which will\r\ndetermine whether or not the record is actually dirty","created_at":"2017-05-26T23:35:38Z","updated_at":"2017-06-01T16:30:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d9ae381dc169ccba4e593d71793ec3a15a596b33","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/pulls/133/commits","review_comments_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/pulls/133/comments","review_comment_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/issues/133/comments","statuses_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/statuses/269bdfd138c510a9d6c3d48d68bf4d659e29a103","head":{"label":"nbey:activerecord-dirtyness","ref":"activerecord-dirtyness","sha":"269bdfd138c510a9d6c3d48d68bf4d659e29a103","user":{"login":"nbey","id":984849,"avatar_url":"https://avatars0.githubusercontent.com/u/984849?v=3","gravatar_id":"","url":"https://api.github.com/users/nbey","html_url":"https://github.com/nbey","followers_url":"https://api.github.com/users/nbey/followers","following_url":"https://api.github.com/users/nbey/following{/other_user}","gists_url":"https://api.github.com/users/nbey/gists{/gist_id}","starred_url":"https://api.github.com/users/nbey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbey/subscriptions","organizations_url":"https://api.github.com/users/nbey/orgs","repos_url":"https://api.github.com/users/nbey/repos","events_url":"https://api.github.com/users/nbey/events{/privacy}","received_events_url":"https://api.github.com/users/nbey/received_events","type":"User","site_admin":false},"repo":{"id":45144910,"name":"Emergence-Skeleton","full_name":"nbey/Emergence-Skeleton","owner":{"login":"nbey","id":984849,"avatar_url":"https://avatars0.githubusercontent.com/u/984849?v=3","gravatar_id":"","url":"https://api.github.com/users/nbey","html_url":"https://github.com/nbey","followers_url":"https://api.github.com/users/nbey/followers","following_url":"https://api.github.com/users/nbey/following{/other_user}","gists_url":"https://api.github.com/users/nbey/gists{/gist_id}","starred_url":"https://api.github.com/users/nbey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbey/subscriptions","organizations_url":"https://api.github.com/users/nbey/orgs","repos_url":"https://api.github.com/users/nbey/repos","events_url":"https://api.github.com/users/nbey/events{/privacy}","received_events_url":"https://api.github.com/users/nbey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nbey/Emergence-Skeleton","description":"Contains a base Emergence site and all the framework's classes.","fork":true,"url":"https://api.github.com/repos/nbey/Emergence-Skeleton","forks_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/forks","keys_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/teams","hooks_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/hooks","issue_events_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/issues/events{/number}","events_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/events","assignees_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/assignees{/user}","branches_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/branches{/branch}","tags_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/tags","blobs_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/git/refs{/sha}","trees_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/statuses/{sha}","languages_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/languages","stargazers_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/stargazers","contributors_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/contributors","subscribers_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/subscribers","subscription_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/subscription","commits_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/commits{/sha}","git_commits_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/git/commits{/sha}","comments_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/comments{/number}","issue_comment_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/issues/comments{/number}","contents_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/contents/{+path}","compare_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/merges","archive_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/downloads","issues_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/issues{/number}","pulls_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/pulls{/number}","milestones_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/milestones{/number}","notifications_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/labels{/name}","releases_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/releases{/id}","deployments_url":"https://api.github.com/repos/nbey/Emergence-Skeleton/deployments","created_at":"2015-10-28T22:11:49Z","updated_at":"2016-01-18T16:37:24Z","pushed_at":"2017-05-26T23:34:15Z","git_url":"git://github.com/nbey/Emergence-Skeleton.git","ssh_url":"git@github.com:nbey/Emergence-Skeleton.git","clone_url":"https://github.com/nbey/Emergence-Skeleton.git","svn_url":"https://github.com/nbey/Emergence-Skeleton","homepage":null,"size":10269,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"JarvusInnovations:master","ref":"master","sha":"b71aaa15179d8bd386bbf04461e5577706f5e4e5","user":{"login":"JarvusInnovations","id":609450,"avatar_url":"https://avatars0.githubusercontent.com/u/609450?v=3","gravatar_id":"","url":"https://api.github.com/users/JarvusInnovations","html_url":"https://github.com/JarvusInnovations","followers_url":"https://api.github.com/users/JarvusInnovations/followers","following_url":"https://api.github.com/users/JarvusInnovations/following{/other_user}","gists_url":"https://api.github.com/users/JarvusInnovations/gists{/gist_id}","starred_url":"https://api.github.com/users/JarvusInnovations/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JarvusInnovations/subscriptions","organizations_url":"https://api.github.com/users/JarvusInnovations/orgs","repos_url":"https://api.github.com/users/JarvusInnovations/repos","events_url":"https://api.github.com/users/JarvusInnovations/events{/privacy}","received_events_url":"https://api.github.com/users/JarvusInnovations/received_events","type":"Organization","site_admin":false},"repo":{"id":4376200,"name":"emergence-skeleton","full_name":"JarvusInnovations/emergence-skeleton","owner":{"login":"JarvusInnovations","id":609450,"avatar_url":"https://avatars0.githubusercontent.com/u/609450?v=3","gravatar_id":"","url":"https://api.github.com/users/JarvusInnovations","html_url":"https://github.com/JarvusInnovations","followers_url":"https://api.github.com/users/JarvusInnovations/followers","following_url":"https://api.github.com/users/JarvusInnovations/following{/other_user}","gists_url":"https://api.github.com/users/JarvusInnovations/gists{/gist_id}","starred_url":"https://api.github.com/users/JarvusInnovations/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JarvusInnovations/subscriptions","organizations_url":"https://api.github.com/users/JarvusInnovations/orgs","repos_url":"https://api.github.com/users/JarvusInnovations/repos","events_url":"https://api.github.com/users/JarvusInnovations/events{/privacy}","received_events_url":"https://api.github.com/users/JarvusInnovations/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JarvusInnovations/emergence-skeleton","description":"Contains a base Emergence site and all the framework's classes.","fork":false,"url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton","forks_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/forks","keys_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/teams","hooks_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/hooks","issue_events_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/issues/events{/number}","events_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/events","assignees_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/assignees{/user}","branches_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/branches{/branch}","tags_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/tags","blobs_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/git/refs{/sha}","trees_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/statuses/{sha}","languages_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/languages","stargazers_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/stargazers","contributors_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/contributors","subscribers_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/subscribers","subscription_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/subscription","commits_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/commits{/sha}","git_commits_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/git/commits{/sha}","comments_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/comments{/number}","issue_comment_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/issues/comments{/number}","contents_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/contents/{+path}","compare_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/merges","archive_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/downloads","issues_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/issues{/number}","pulls_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/pulls{/number}","milestones_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/milestones{/number}","notifications_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/labels{/name}","releases_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/releases{/id}","deployments_url":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/deployments","created_at":"2012-05-19T06:12:10Z","updated_at":"2016-10-31T16:33:56Z","pushed_at":"2017-06-01T16:01:44Z","git_url":"git://github.com/JarvusInnovations/emergence-skeleton.git","ssh_url":"git@github.com:JarvusInnovations/emergence-skeleton.git","clone_url":"https://github.com/JarvusInnovations/emergence-skeleton.git","svn_url":"https://github.com/JarvusInnovations/emergence-skeleton","homepage":null,"size":13312,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":18,"forks":5,"open_issues":18,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/pulls/133"},"html":{"href":"https://github.com/JarvusInnovations/emergence-skeleton/pull/133"},"issue":{"href":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/issues/133"},"comments":{"href":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/issues/133/comments"},"review_comments":{"href":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/pulls/133/comments"},"review_comment":{"href":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/pulls/133/commits"},"statuses":{"href":"https://api.github.com/repos/JarvusInnovations/emergence-skeleton/statuses/269bdfd138c510a9d6c3d48d68bf4d659e29a103"}}}}
{"actor":{"display_login":"nbey"}}