Merge pull request #374 from strongloop/fix-conflict-resolution

[2.0] Fix conflict resolution
This commit is contained in:
Miroslav Bajtoš 2014-07-15 20:51:08 +02:00
commit b24d1e942b
2 changed files with 3 additions and 1 deletions

View File

@ -154,6 +154,8 @@ app.model = function (Model, config) {
if (isPublic && Model.sharedClass) { if (isPublic && Model.sharedClass) {
this.remotes().addClass(Model.sharedClass); this.remotes().addClass(Model.sharedClass);
if (Model.settings.trackChanges && Model.Change)
this.remotes().addClass(Model.Change.sharedClass);
clearHandlerCache(this); clearHandlerCache(this);
} }

View File

@ -609,7 +609,7 @@ Conflict.prototype.changes = function(cb) {
Conflict.prototype.resolve = function(cb) { Conflict.prototype.resolve = function(cb) {
var conflict = this; var conflict = this;
conflict.changes(function(err, sourceChange, targetChange) { conflict.changes(function(err, sourceChange, targetChange) {
if(err) return callback(err); if(err) return cb(err);
sourceChange.prev = targetChange.rev; sourceChange.prev = targetChange.rev;
sourceChange.save(cb); sourceChange.save(cb);
}); });