{"action":"created","comment":{"url":"https://api.github.com/repos/sequelize/sequelize/pulls/comments/24564269","id":24564269,"diff_hunk":"@@ -351,8 +351,8 @@ module.exports = (function() {\n             value = _.isString(value) ? !!parseInt(value, 10) : !!value;\n           }\n \n-          if (!options.raw && originalValue !== value) {\n-            this._previousDataValues[key] = originalValue;\n+          if (!options.raw && (options.isNewRecord || options.reset)) {\n+            this._previousDataValues[key] = value;","path":"lib/instance.js","position":7,"original_position":7,"commit_id":"13a167a6a70ea0441b874d16870350cc1ba55e4d","original_commit_id":"13a167a6a70ea0441b874d16870350cc1ba55e4d","user":{"login":"mickhansen","id":699049,"avatar_url":"https://avatars.githubusercontent.com/u/699049?v=3","gravatar_id":"","url":"https://api.github.com/users/mickhansen","html_url":"https://github.com/mickhansen","followers_url":"https://api.github.com/users/mickhansen/followers","following_url":"https://api.github.com/users/mickhansen/following{/other_user}","gists_url":"https://api.github.com/users/mickhansen/gists{/gist_id}","starred_url":"https://api.github.com/users/mickhansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mickhansen/subscriptions","organizations_url":"https://api.github.com/users/mickhansen/orgs","repos_url":"https://api.github.com/users/mickhansen/repos","events_url":"https://api.github.com/users/mickhansen/events{/privacy}","received_events_url":"https://api.github.com/users/mickhansen/received_events","type":"User","site_admin":false},"body":"Shouldn't this still be `originalValue`?","created_at":"2015-02-12T08:12:21Z","updated_at":"2015-02-12T08:12:21Z","html_url":"https://github.com/sequelize/sequelize/pull/3112#discussion_r24564269","pull_request_url":"https://api.github.com/repos/sequelize/sequelize/pulls/3112","_links":{"self":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/comments/24564269"},"html":{"href":"https://github.com/sequelize/sequelize/pull/3112#discussion_r24564269"},"pull_request":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/3112"}}},"pull_request":{"url":"https://api.github.com/repos/sequelize/sequelize/pulls/3112","id":29142022,"html_url":"https://github.com/sequelize/sequelize/pull/3112","diff_url":"https://github.com/sequelize/sequelize/pull/3112.diff","patch_url":"https://github.com/sequelize/sequelize/pull/3112.patch","issue_url":"https://api.github.com/repos/sequelize/sequelize/issues/3112","number":3112,"state":"open","locked":false,"title":"Fix bug where setting same date twice would prevent persistence","user":{"login":"ryanpon","id":1989580,"avatar_url":"https://avatars.githubusercontent.com/u/1989580?v=3","gravatar_id":"","url":"https://api.github.com/users/ryanpon","html_url":"https://github.com/ryanpon","followers_url":"https://api.github.com/users/ryanpon/followers","following_url":"https://api.github.com/users/ryanpon/following{/other_user}","gists_url":"https://api.github.com/users/ryanpon/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanpon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanpon/subscriptions","organizations_url":"https://api.github.com/users/ryanpon/orgs","repos_url":"https://api.github.com/users/ryanpon/repos","events_url":"https://api.github.com/users/ryanpon/events{/privacy}","received_events_url":"https://api.github.com/users/ryanpon/received_events","type":"User","site_admin":false},"body":"This issue was caused by the difference in comparisons between\r\nInstance.set and Instance.changed. Dates were being compared with !==\r\nin #set, but with #valueOf in #changed. The _previousDataValue\r\nwould thus always get overwritten when setting a date field. This means\r\nthat performing a set on a Date field twice with two different Date\r\nobjects with the *same* #valueOf would trick Sequelize into thinking\r\nthat the field was clean.\r\n\r\nThis fix would change the behavior of Instance.previous in cases where the field has been set more than once. I believe this shouldn't be an issue given that the last value from the database is probably the most useful thing to return.","created_at":"2015-02-12T00:19:06Z","updated_at":"2015-02-12T08:12:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f10a9efcf86c8da47d2ce5c0245fdda23a923102","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sequelize/sequelize/pulls/3112/commits","review_comments_url":"https://api.github.com/repos/sequelize/sequelize/pulls/3112/comments","review_comment_url":"https://api.github.com/repos/sequelize/sequelize/pulls/comments/{number}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/3112/comments","statuses_url":"https://api.github.com/repos/sequelize/sequelize/statuses/13a167a6a70ea0441b874d16870350cc1ba55e4d","head":{"label":"meetearnest:master","ref":"master","sha":"13a167a6a70ea0441b874d16870350cc1ba55e4d","user":{"login":"meetearnest","id":5545226,"avatar_url":"https://avatars.githubusercontent.com/u/5545226?v=3","gravatar_id":"","url":"https://api.github.com/users/meetearnest","html_url":"https://github.com/meetearnest","followers_url":"https://api.github.com/users/meetearnest/followers","following_url":"https://api.github.com/users/meetearnest/following{/other_user}","gists_url":"https://api.github.com/users/meetearnest/gists{/gist_id}","starred_url":"https://api.github.com/users/meetearnest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meetearnest/subscriptions","organizations_url":"https://api.github.com/users/meetearnest/orgs","repos_url":"https://api.github.com/users/meetearnest/repos","events_url":"https://api.github.com/users/meetearnest/events{/privacy}","received_events_url":"https://api.github.com/users/meetearnest/received_events","type":"Organization","site_admin":false},"repo":{"id":21254088,"name":"sequelize","full_name":"meetearnest/sequelize","owner":{"login":"meetearnest","id":5545226,"avatar_url":"https://avatars.githubusercontent.com/u/5545226?v=3","gravatar_id":"","url":"https://api.github.com/users/meetearnest","html_url":"https://github.com/meetearnest","followers_url":"https://api.github.com/users/meetearnest/followers","following_url":"https://api.github.com/users/meetearnest/following{/other_user}","gists_url":"https://api.github.com/users/meetearnest/gists{/gist_id}","starred_url":"https://api.github.com/users/meetearnest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meetearnest/subscriptions","organizations_url":"https://api.github.com/users/meetearnest/orgs","repos_url":"https://api.github.com/users/meetearnest/repos","events_url":"https://api.github.com/users/meetearnest/events{/privacy}","received_events_url":"https://api.github.com/users/meetearnest/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/meetearnest/sequelize","description":"Sequelize is an easy-to-use multi sql dialect object-relationship-mapper for node.js. It currently supports MySQL, MariaDB, SQLite and PostgreSQL.","fork":true,"url":"https://api.github.com/repos/meetearnest/sequelize","forks_url":"https://api.github.com/repos/meetearnest/sequelize/forks","keys_url":"https://api.github.com/repos/meetearnest/sequelize/keys{/key_id}","collaborators_url":"https://api.github.com/repos/meetearnest/sequelize/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/meetearnest/sequelize/teams","hooks_url":"https://api.github.com/repos/meetearnest/sequelize/hooks","issue_events_url":"https://api.github.com/repos/meetearnest/sequelize/issues/events{/number}","events_url":"https://api.github.com/repos/meetearnest/sequelize/events","assignees_url":"https://api.github.com/repos/meetearnest/sequelize/assignees{/user}","branches_url":"https://api.github.com/repos/meetearnest/sequelize/branches{/branch}","tags_url":"https://api.github.com/repos/meetearnest/sequelize/tags","blobs_url":"https://api.github.com/repos/meetearnest/sequelize/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/meetearnest/sequelize/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/meetearnest/sequelize/git/refs{/sha}","trees_url":"https://api.github.com/repos/meetearnest/sequelize/git/trees{/sha}","statuses_url":"https://api.github.com/repos/meetearnest/sequelize/statuses/{sha}","languages_url":"https://api.github.com/repos/meetearnest/sequelize/languages","stargazers_url":"https://api.github.com/repos/meetearnest/sequelize/stargazers","contributors_url":"https://api.github.com/repos/meetearnest/sequelize/contributors","subscribers_url":"https://api.github.com/repos/meetearnest/sequelize/subscribers","subscription_url":"https://api.github.com/repos/meetearnest/sequelize/subscription","commits_url":"https://api.github.com/repos/meetearnest/sequelize/commits{/sha}","git_commits_url":"https://api.github.com/repos/meetearnest/sequelize/git/commits{/sha}","comments_url":"https://api.github.com/repos/meetearnest/sequelize/comments{/number}","issue_comment_url":"https://api.github.com/repos/meetearnest/sequelize/issues/comments/{number}","contents_url":"https://api.github.com/repos/meetearnest/sequelize/contents/{+path}","compare_url":"https://api.github.com/repos/meetearnest/sequelize/compare/{base}...{head}","merges_url":"https://api.github.com/repos/meetearnest/sequelize/merges","archive_url":"https://api.github.com/repos/meetearnest/sequelize/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/meetearnest/sequelize/downloads","issues_url":"https://api.github.com/repos/meetearnest/sequelize/issues{/number}","pulls_url":"https://api.github.com/repos/meetearnest/sequelize/pulls{/number}","milestones_url":"https://api.github.com/repos/meetearnest/sequelize/milestones{/number}","notifications_url":"https://api.github.com/repos/meetearnest/sequelize/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/meetearnest/sequelize/labels{/name}","releases_url":"https://api.github.com/repos/meetearnest/sequelize/releases{/id}","created_at":"2014-06-26T20:31:39Z","updated_at":"2015-02-12T00:14:57Z","pushed_at":"2015-02-12T00:14:56Z","git_url":"git://github.com/meetearnest/sequelize.git","ssh_url":"git@github.com:meetearnest/sequelize.git","clone_url":"https://github.com/meetearnest/sequelize.git","svn_url":"https://github.com/meetearnest/sequelize","homepage":"http://sequelizejs.com","size":34978,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"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":"master"}},"base":{"label":"sequelize:master","ref":"master","sha":"7790c4fa88a3444f463c8419761ff5fe96f8d024","user":{"login":"sequelize","id":3591786,"avatar_url":"https://avatars.githubusercontent.com/u/3591786?v=3","gravatar_id":"","url":"https://api.github.com/users/sequelize","html_url":"https://github.com/sequelize","followers_url":"https://api.github.com/users/sequelize/followers","following_url":"https://api.github.com/users/sequelize/following{/other_user}","gists_url":"https://api.github.com/users/sequelize/gists{/gist_id}","starred_url":"https://api.github.com/users/sequelize/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sequelize/subscriptions","organizations_url":"https://api.github.com/users/sequelize/orgs","repos_url":"https://api.github.com/users/sequelize/repos","events_url":"https://api.github.com/users/sequelize/events{/privacy}","received_events_url":"https://api.github.com/users/sequelize/received_events","type":"Organization","site_admin":false},"repo":{"id":790359,"name":"sequelize","full_name":"sequelize/sequelize","owner":{"login":"sequelize","id":3591786,"avatar_url":"https://avatars.githubusercontent.com/u/3591786?v=3","gravatar_id":"","url":"https://api.github.com/users/sequelize","html_url":"https://github.com/sequelize","followers_url":"https://api.github.com/users/sequelize/followers","following_url":"https://api.github.com/users/sequelize/following{/other_user}","gists_url":"https://api.github.com/users/sequelize/gists{/gist_id}","starred_url":"https://api.github.com/users/sequelize/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sequelize/subscriptions","organizations_url":"https://api.github.com/users/sequelize/orgs","repos_url":"https://api.github.com/users/sequelize/repos","events_url":"https://api.github.com/users/sequelize/events{/privacy}","received_events_url":"https://api.github.com/users/sequelize/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sequelize/sequelize","description":"Sequelize is an easy-to-use multi sql dialect object-relationship-mapper for Node.js & io.js. It currently supports MySQL, MariaDB, SQLite, PostgreSQL and MSSQL.","fork":false,"url":"https://api.github.com/repos/sequelize/sequelize","forks_url":"https://api.github.com/repos/sequelize/sequelize/forks","keys_url":"https://api.github.com/repos/sequelize/sequelize/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sequelize/sequelize/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sequelize/sequelize/teams","hooks_url":"https://api.github.com/repos/sequelize/sequelize/hooks","issue_events_url":"https://api.github.com/repos/sequelize/sequelize/issues/events{/number}","events_url":"https://api.github.com/repos/sequelize/sequelize/events","assignees_url":"https://api.github.com/repos/sequelize/sequelize/assignees{/user}","branches_url":"https://api.github.com/repos/sequelize/sequelize/branches{/branch}","tags_url":"https://api.github.com/repos/sequelize/sequelize/tags","blobs_url":"https://api.github.com/repos/sequelize/sequelize/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sequelize/sequelize/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sequelize/sequelize/git/refs{/sha}","trees_url":"https://api.github.com/repos/sequelize/sequelize/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sequelize/sequelize/statuses/{sha}","languages_url":"https://api.github.com/repos/sequelize/sequelize/languages","stargazers_url":"https://api.github.com/repos/sequelize/sequelize/stargazers","contributors_url":"https://api.github.com/repos/sequelize/sequelize/contributors","subscribers_url":"https://api.github.com/repos/sequelize/sequelize/subscribers","subscription_url":"https://api.github.com/repos/sequelize/sequelize/subscription","commits_url":"https://api.github.com/repos/sequelize/sequelize/commits{/sha}","git_commits_url":"https://api.github.com/repos/sequelize/sequelize/git/commits{/sha}","comments_url":"https://api.github.com/repos/sequelize/sequelize/comments{/number}","issue_comment_url":"https://api.github.com/repos/sequelize/sequelize/issues/comments/{number}","contents_url":"https://api.github.com/repos/sequelize/sequelize/contents/{+path}","compare_url":"https://api.github.com/repos/sequelize/sequelize/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sequelize/sequelize/merges","archive_url":"https://api.github.com/repos/sequelize/sequelize/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sequelize/sequelize/downloads","issues_url":"https://api.github.com/repos/sequelize/sequelize/issues{/number}","pulls_url":"https://api.github.com/repos/sequelize/sequelize/pulls{/number}","milestones_url":"https://api.github.com/repos/sequelize/sequelize/milestones{/number}","notifications_url":"https://api.github.com/repos/sequelize/sequelize/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sequelize/sequelize/labels{/name}","releases_url":"https://api.github.com/repos/sequelize/sequelize/releases{/id}","created_at":"2010-07-22T07:11:11Z","updated_at":"2015-02-12T07:35:12Z","pushed_at":"2015-02-12T07:35:12Z","git_url":"git://github.com/sequelize/sequelize.git","ssh_url":"git@github.com:sequelize/sequelize.git","clone_url":"https://github.com/sequelize/sequelize.git","svn_url":"https://github.com/sequelize/sequelize","homepage":"http://sequelizejs.com","size":52292,"stargazers_count":3193,"watchers_count":3193,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":736,"mirror_url":null,"open_issues_count":342,"forks":736,"open_issues":342,"watchers":3193,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/3112"},"html":{"href":"https://github.com/sequelize/sequelize/pull/3112"},"issue":{"href":"https://api.github.com/repos/sequelize/sequelize/issues/3112"},"comments":{"href":"https://api.github.com/repos/sequelize/sequelize/issues/3112/comments"},"review_comments":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/3112/comments"},"review_comment":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/3112/commits"},"statuses":{"href":"https://api.github.com/repos/sequelize/sequelize/statuses/13a167a6a70ea0441b874d16870350cc1ba55e4d"}}}}