Skip to content

Instantly share code, notes, and snippets.

@george
Created September 7, 2012 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save george/3669415 to your computer and use it in GitHub Desktop.
Save george/3669415 to your computer and use it in GitHub Desktop.
SocialRoi.Report = DS.Model.extend
name: DS.attr('string')
configuration_state: DS.attr('string')
enterprise_guid: DS.attr('string')
enterprise_name: DS.attr('string')
enterprise_guid: DS.attr('string')
site_name: DS.attr('string')
site_id: DS.attr('number')
program_name: DS.attr('string')
program_id: DS.attr('number')
enterprises: (->
ents = SocialRoi.Enterprise.find()
console.log ents.get('length')
ents
).property()
enterprisesLoaded: (->
ents = @get('enterprises')
console.log 'enterprises.length: ', ents.get('length')
).observes('@each.enterprises') // <= doesn't work
//).observes('enterprises') // <= also doesn't work
// I'm trying to hook the call to SocialRoi.Enterprise.find() so when it returns data
// I can look at the length of the array.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment