Skip to content

Instantly share code, notes, and snippets.

@ColinCampbell
Created September 19, 2011 22:40
Show Gist options
  • Save ColinCampbell/1227807 to your computer and use it in GitHub Desktop.
Save ColinCampbell/1227807 to your computer and use it in GitHub Desktop.
MyApp.Application = SC.Record.extend({
assignments: function() {
var data = this._data_assignments,
id = this.get('id'), query;
if (!data && id) {
query = SC.Query.local(MyApp.Assignment, 'application = {application}', {application: this});
data = this._data_assignments = MyApp.get('store').find(query);
}
return data;
}.property('id').cacheable()
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment