mirror of
https://github.com/zhigang1992/deployd.git
synced 2026-05-13 12:37:17 +08:00
fixed #107, changed() returning incorrect true when values were equal
This commit is contained in:
@@ -440,7 +440,13 @@ Collection.prototype.save = function (ctx, fn) {
|
||||
};
|
||||
|
||||
domain.changed = function (property) {
|
||||
if(domain.data.hasOwnProperty(property)) return true;
|
||||
if(domain.data.hasOwnProperty(property)) {
|
||||
if(domain.previous && domain.previous[property] === domain.data[property]) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
@@ -466,7 +472,8 @@ Collection.prototype.save = function (ctx, fn) {
|
||||
prev[key] = obj[key];
|
||||
obj[key] = item[key];
|
||||
});
|
||||
|
||||
|
||||
prev.id = id;
|
||||
item = obj;
|
||||
domain['this'] = item;
|
||||
domain.data = item;
|
||||
|
||||
Reference in New Issue
Block a user