{"action":"created","issue":{"url":"https://api.github.com/repos/toranb/ember-cli-simple-store/issues/7","labels_url":"https://api.github.com/repos/toranb/ember-cli-simple-store/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/toranb/ember-cli-simple-store/issues/7/comments","events_url":"https://api.github.com/repos/toranb/ember-cli-simple-store/issues/7/events","html_url":"https://github.com/toranb/ember-cli-simple-store/pull/7","id":65012168,"number":7,"title":"Dirty tracking","user":{"login":"williamsbdev","id":2402655,"avatar_url":"https://avatars.githubusercontent.com/u/2402655?v=3","gravatar_id":"","url":"https://api.github.com/users/williamsbdev","html_url":"https://github.com/williamsbdev","followers_url":"https://api.github.com/users/williamsbdev/followers","following_url":"https://api.github.com/users/williamsbdev/following{/other_user}","gists_url":"https://api.github.com/users/williamsbdev/gists{/gist_id}","starred_url":"https://api.github.com/users/williamsbdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/williamsbdev/subscriptions","organizations_url":"https://api.github.com/users/williamsbdev/orgs","repos_url":"https://api.github.com/users/williamsbdev/repos","events_url":"https://api.github.com/users/williamsbdev/events{/privacy}","received_events_url":"https://api.github.com/users/williamsbdev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2015-03-29T01:58:33Z","updated_at":"2015-04-05T00:34:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/toranb/ember-cli-simple-store/pulls/7","html_url":"https://github.com/toranb/ember-cli-simple-store/pull/7","diff_url":"https://github.com/toranb/ember-cli-simple-store/pull/7.diff","patch_url":"https://github.com/toranb/ember-cli-simple-store/pull/7.patch"},"body":"This PR introduces the ability to set a property back to it's original value and the model will correctly show that it is no longer dirty (isDirty returns false).\r\n\r\nPlease note that if the value was undefined, null, or empty \"\", that any and all of these values are accepted as returning to the original value.\r\n\r\nExamples:\r\n```javascript\r\nperson.get(\"foo\") === undefined; // initial so isDirty === false\r\nperson.set(\"foo\", \"wat\");               // isDirty === true\r\nperson.set(\"foo\", undefined);       // isDirty === false\r\nperson.set(\"foo\", \"\");                    // isDirty === false\r\nperson.set(\"foo\", null);                 // isDirty === false\r\n\r\nperson.get(\"foo\") === null;     // initial so isDirty === false\r\nperson.set(\"foo\", \"wat\");         // isDirty === true\r\nperson.set(\"foo\", undefined); // isDirty === false\r\nperson.set(\"foo\", \"\");              // isDirty === false\r\nperson.set(\"foo\", null);           // isDirty === false\r\n\r\nperson.get(\"foo\") === \"\";        // initial so isDirty === false\r\nperson.set(\"foo\", \"wat\");         // isDirty === true\r\nperson.set(\"foo\", undefined); // isDirty === false\r\nperson.set(\"foo\", \"\");              // isDirty === false\r\nperson.set(\"foo\", null);           // isDirty === false\r\n```\r\n\r\nAdditionally, during this PR, I discovered and wrote a test the following scenario.\r\n\r\n```javascript\r\nperson.get(\"foo\") === 0; // initial so isDirty === false\r\nperson.set(\"foo\", \"wat\"); // isDirty === true\r\nperson.set(\"foo\", 0);       // isDirty === false\r\nperson.set(\"foo\", \"0\");    // isDirty === true\r\n```\r\n\r\nI just wanted to show that we do not try to treat a string and int like the same value and if it gets updated, it may cause confusion for devs who are doing a console.log as they appear to be the same value but are two different types."},"comment":{"url":"https://api.github.com/repos/toranb/ember-cli-simple-store/issues/comments/89693409","html_url":"https://github.com/toranb/ember-cli-simple-store/pull/7#issuecomment-89693409","issue_url":"https://api.github.com/repos/toranb/ember-cli-simple-store/issues/7","id":89693409,"user":{"login":"williamsbdev","id":2402655,"avatar_url":"https://avatars.githubusercontent.com/u/2402655?v=3","gravatar_id":"","url":"https://api.github.com/users/williamsbdev","html_url":"https://github.com/williamsbdev","followers_url":"https://api.github.com/users/williamsbdev/followers","following_url":"https://api.github.com/users/williamsbdev/following{/other_user}","gists_url":"https://api.github.com/users/williamsbdev/gists{/gist_id}","starred_url":"https://api.github.com/users/williamsbdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/williamsbdev/subscriptions","organizations_url":"https://api.github.com/users/williamsbdev/orgs","repos_url":"https://api.github.com/users/williamsbdev/repos","events_url":"https://api.github.com/users/williamsbdev/events{/privacy}","received_events_url":"https://api.github.com/users/williamsbdev/received_events","type":"User","site_admin":false},"created_at":"2015-04-05T00:34:53Z","updated_at":"2015-04-05T00:34:53Z","body":"I believe the PR is ready to go. LGTM. Would you like me to take point on merging into both the releases 0.9 and 1.0 beta?"}}