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:
Sean McArthur 2011-10-28 11:09:44 -05:00
Родитель c4ed7c21db
Коммит ed8b399d5c
5 изменённых файлов: 16 добавлений и 11 удалений

Просмотреть файл

@ -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
}
},