Skip to content

Instantly share code, notes, and snippets.

@seanmonstar
Created July 19, 2011 20:31
Show Gist options
  • Select an option

  • Save seanmonstar/1093628 to your computer and use it in GitHub Desktop.

Select an option

Save seanmonstar/1093628 to your computer and use it in GitHub Desktop.
Shipyard Sync
var Class = require('../../lib/class'),
model = require('../../lib/model'),
AjaxSync = require('../../lib/sync/Ajax');
var Task = module.exports = new Class({
Extends: model.Model,
fields: {
id: model.fields.NumberField(),
title: model.fields.TextField(),
created_at: model.fields.DateField(),
is_done: model.fields.BooleanField()
},
toString: function() {
return this.get('title');
}
});
new AjaxSync(Task, {
path: '/tasks/'
});
var Class = require('../../lib/class'),
model = require('../../lib/model'),
AjaxSync = require('../../lib/sync/Ajax');
var Task = module.exports = new Class({
Extends: model.Model,
Implements: AjaxSync,
syncOptions: {
path: '/tasks/'
},
fields: {
id: model.fields.NumberField(),
title: model.fields.TextField(),
created_at: model.fields.DateField(),
is_done: model.fields.BooleanField()
},
toString: function() {
return this.get('title');
}
});
var Class = require('../../lib/class'),
model = require('../../lib/model'),
AjaxSync = require('../../lib/sync/Ajax');
var Task = module.exports = new Class({
Extends: model.Model,
Sync: {
driver: AjaxSync,
path: '/tasks/'
},
fields: {
id: model.fields.NumberField(),
title: model.fields.TextField(),
created_at: model.fields.DateField(),
is_done: model.fields.BooleanField()
},
toString: function() {
return this.get('title');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment