不要怂,就是干,撸起袖子干!

Commit 938aaf50 by Mick Hansen

Merge pull request #3939 from MrVoltz/patch-1

.equals() should compare dataValues directly
2 parents 39e0ce5a 48f41f29
Showing with 7 additions and 3 deletions
......@@ -994,11 +994,15 @@ Instance.prototype.decrement = function(fields, options) {
Instance.prototype.equals = function(other) {
var result = true;
if (!other || !other.dataValues) {
return false;
}
Utils._.each(this.dataValues, function(value, key) {
if (Utils._.isDate(value) && Utils._.isDate(other[key])) {
result = result && (value.getTime() === other[key].getTime());
if (Utils._.isDate(value) && Utils._.isDate(other.dataValues[key])) {
result = result && (value.getTime() === other.dataValues[key].getTime());
} else {
result = result && (value === other[key]);
result = result && (value === other.dataValues[key]);
}
});
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!