Created
May 29, 2013 17:31
-
-
Save publickeating/5672130 to your computer and use it in GitHub Desktop.
This file contains 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
MyApp.Group = SC.Record.extend({ | |
name: SC.Record.attr(String), | |
people: function () { | |
var query, | |
ret; | |
query = SC.Query.local(MyApp.Person, { | |
conditions: 'group = {self}', | |
parameters: { self: this } | |
}); | |
ret = this.get('store').find(query); | |
return ret; | |
}.property().cacheable() | |
}); | |
MyApp.Person = SC.Record.extend({ | |
name: SC.Record.attr(String), | |
group: SC.Record.toOne('MyApp.Group') | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment