Created
April 16, 2010 17:52
-
-
Save erichocean/368729 to your computer and use it in GitHub Desktop.
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