From 087c602669740f968c544410f669065b556c4c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Tue, 15 Jul 2014 09:14:54 +0200 Subject: [PATCH 1/2] models/change: fix typo --- lib/models/change.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/models/change.js b/lib/models/change.js index e66a8453..9f291fdd 100644 --- a/lib/models/change.js +++ b/lib/models/change.js @@ -609,7 +609,7 @@ Conflict.prototype.changes = function(cb) { Conflict.prototype.resolve = function(cb) { var conflict = this; conflict.changes(function(err, sourceChange, targetChange) { - if(err) return callback(err); + if(err) return cb(err); sourceChange.prev = targetChange.rev; sourceChange.save(cb); }); From da9b7242222acc87268983aac0c813e81d710cef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Tue, 15 Jul 2014 09:31:16 +0200 Subject: [PATCH 2/2] lib/application: publish Change models to REST API When a public model is added to an application and the model has change tracking enabled, its Change model is added to the public models. Before this change, conflict resolution in the browser was not working, because it was not possible to fetch the remote change. --- lib/application.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/application.js b/lib/application.js index d588fafd..228d4d1a 100644 --- a/lib/application.js +++ b/lib/application.js @@ -154,6 +154,8 @@ app.model = function (Model, config) { if (isPublic && Model.sharedClass) { this.remotes().addClass(Model.sharedClass); + if (Model.settings.trackChanges && Model.Change) + this.remotes().addClass(Model.Change.sharedClass); clearHandlerCache(this); }