Guest User

Untitled

a guest
May 27th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. MyApp.User = SC.Record.extend({
  2.  
  3. username: SC.Record.attr(String),
  4.  
  5. contactEmail: SC.Record.attr(String),
  6.  
  7.  
  8.  
  9. account: SC.Record.toOne(“MyApp.Account”, {
  10.  
  11. inverse: “users”, isMaster: NO
  12.  
  13. }),
  14.  
  15.  
  16.  
  17. groups: SC.Record.toMany(“MyApp.UserGroup”, {
  18.  
  19. inverse: “users”, isMaster: NO
  20.  
  21. }),
  22.  
  23.  
  24.  
  25. belongsToGroup: function(group) {
  26.  
  27. return !!this.get(‘groups’).findProperty(‘name’, group);
  28.  
  29. }.property(‘groups’).cacheable()
  30.  
  31. });
Add Comment
Please, Sign In to add comment