Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MyApp.User = SC.Record.extend({
- username: SC.Record.attr(String),
- contactEmail: SC.Record.attr(String),
- account: SC.Record.toOne(“MyApp.Account”, {
- inverse: “users”, isMaster: NO
- }),
- groups: SC.Record.toMany(“MyApp.UserGroup”, {
- inverse: “users”, isMaster: NO
- }),
- belongsToGroup: function(group) {
- return !!this.get(‘groups’).findProperty(‘name’, group);
- }.property(‘groups’).cacheable()
- });
Add Comment
Please, Sign In to add comment