Backport of #2565
This commit is contained in:
parent
b3c66f34c8
commit
fa8ac8d324
|
@ -25,14 +25,25 @@ describe('RemoteConnector', function() {
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// We are defining the model attached to the remote connector datasource,
|
||||||
|
// therefore change tracking must be disabled, only the remote API for
|
||||||
|
// replication should be present
|
||||||
|
trackChanges: false,
|
||||||
|
enableRemoteReplication: true,
|
||||||
|
|
||||||
onDefine: function(Model) {
|
onDefine: function(Model) {
|
||||||
var RemoteModel = Model.extend('Remote' + Model.modelName, {},
|
var ServerModel = Model.extend('Server' + Model.modelName, {}, {
|
||||||
{ plural: Model.pluralModelName });
|
plural: Model.pluralModelName,
|
||||||
RemoteModel.attachTo(loopback.createDataSource({
|
// This is the model running on the server & attached to a real
|
||||||
connector: loopback.Memory
|
// datasource, that's the place where to keep track of changes
|
||||||
|
trackChanges: true,
|
||||||
|
});
|
||||||
|
ServerModel.attachTo(loopback.createDataSource({
|
||||||
|
connector: loopback.Memory,
|
||||||
}));
|
}));
|
||||||
remoteApp.model(RemoteModel);
|
remoteApp.model(ServerModel);
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(function(done) {
|
beforeEach(function(done) {
|
||||||
|
|
|
@ -51,7 +51,8 @@ module.exports = function defineModelTestsWithDataSource(options) {
|
||||||
'domain': String,
|
'domain': String,
|
||||||
'email': String
|
'email': String
|
||||||
}, {
|
}, {
|
||||||
trackChanges: true
|
trackChanges: options.trackChanges !== false,
|
||||||
|
enableRemoteReplication: options.enableRemoteReplication,
|
||||||
});
|
});
|
||||||
|
|
||||||
User.attachTo(dataSource);
|
User.attachTo(dataSource);
|
||||||
|
|
Loading…
Reference in New Issue