зеркало из https://github.com/mozilla/FlightDeck.git
moved to a DummySync for all models
We want to implement Syncable, for the destroy() and toJSON() methods, and that requires we add a Sync to use them (else destroy() will throw an error trying to find the sync to use). We also don't want to currently use the ServerSync, since the new API isn't in place. So Dummy it is!
This commit is contained in:
Родитель
c4ed7c21db
Коммит
ed8b399d5c
|
@ -1,6 +1,6 @@
|
|||
var Class = require('shipyard/class/Class'),
|
||||
fields = require('shipyard/model/fields'),
|
||||
ServerSync = require('shipyard/sync/Server'),
|
||||
DummySync = require('shipyard/sync/Dummy'),
|
||||
|
||||
File = require('./File');
|
||||
|
||||
|
@ -11,8 +11,7 @@ module.exports = new Class({
|
|||
|
||||
Sync: {
|
||||
'default': {
|
||||
driver: ServerSync,
|
||||
route: '/api/0/attachments'
|
||||
driver: DummySync
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ var Class = require('shipyard/class/Class'),
|
|||
Model = require('shipyard/model/Model'),
|
||||
fields = require('shipyard/model/fields'),
|
||||
Syncable = require('shipyard/sync/Syncable'),
|
||||
DummySync = require('shipyard/sync/Dummy'),
|
||||
string = require('shipyard/utils/string');
|
||||
|
||||
var Folder = module.exports = new Class({
|
||||
|
@ -10,7 +11,14 @@ var Folder = module.exports = new Class({
|
|||
|
||||
Implements: Syncable,
|
||||
|
||||
Sync: {
|
||||
'default': {
|
||||
driver: DummySync
|
||||
}
|
||||
},
|
||||
|
||||
fields: {
|
||||
id: fields.NumberField(),
|
||||
name: fields.TextField({ required: true }),
|
||||
root_dir: fields.TextField({ required: true }) //ChoiceField
|
||||
},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
var Class = require('shipyard/class/Class'),
|
||||
File = require('./File'),
|
||||
fields = require('shipyard/model/fields'),
|
||||
ServerSync = require('shipyard/sync/Server'),
|
||||
DummySync = require('shipyard/sync/Dummy'),
|
||||
Request = require('shipyard/http/Request');
|
||||
|
||||
module.exports = new Class({
|
||||
|
@ -10,7 +10,7 @@ module.exports = new Class({
|
|||
|
||||
Sync: {
|
||||
'default': {
|
||||
driver: ServerSync,
|
||||
driver: DummySync,
|
||||
route: '/api/0/modules'
|
||||
}
|
||||
},
|
||||
|
|
|
@ -2,7 +2,7 @@ var Class = require('shipyard/class/Class'),
|
|||
Model = require('shipyard/model/Model'),
|
||||
fields = require('shipyard/model/fields'),
|
||||
Syncable = require('shipyard/sync/Syncable'),
|
||||
ServerSync = require('shipyard/sync/Server');
|
||||
DummySync = require('shipyard/sync/Dummy');
|
||||
|
||||
var Package = module.exports = new Class({
|
||||
|
||||
|
@ -12,8 +12,7 @@ var Package = module.exports = new Class({
|
|||
|
||||
Sync: {
|
||||
'default': {
|
||||
driver: ServerSync,
|
||||
route: '/api/0/packages'
|
||||
driver: DummySync
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ var Class = require('shipyard/class/Class'),
|
|||
Model = require('shipyard/model/Model'),
|
||||
fields = require('shipyard/model/fields'),
|
||||
Syncable = require('shipyard/sync/Syncable'),
|
||||
ServerSync = require('shipyard/sync/Server');
|
||||
DummySync = require('shipyard/sync/Dummy');
|
||||
|
||||
module.exports = new Class({
|
||||
|
||||
|
@ -12,8 +12,7 @@ module.exports = new Class({
|
|||
|
||||
Sync: {
|
||||
'default': {
|
||||
driver: ServerSync,
|
||||
route: '/api/0/packagerevisions'
|
||||
driver: DummySync
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче