Created
April 14, 2010 04:35
-
-
Save erichocean/365457 to your computer and use it in GitHub Desktop.
issues.hub.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Model layer | |
// | |
// Namspace and API | |
Issues = hub.Object.create({ | |
store: hub.Hub.create({ | |
uti: 'com.hub.demo.web', | |
commitRecordsAutomatically: true | |
}), | |
add: function() { | |
var reply = prompt("Issue Description", "New Issue") ; | |
Issues.store.createRecord(Issues.Issue, { | |
description: reply, | |
isDone: false | |
}); | |
} | |
}); | |
// Record definitions | |
Issues.Issue = hub.Record.extend({ | |
isDone: hub.Record.attr(Boolean), | |
description: hub.Record.attr(String) | |
}); | |
Issues.Issue.recordTypeName = 'Issues.Issue' ; | |
// RecordArray definitions | |
Issues.issues = Issues.store.find(hub.Query.local(Issues.Issue, { | |
orderBy: 'isDone,description' | |
})); | |
// Open the Hub | |
Issues.store.checkout() ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment