Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save luxerama/2038069 to your computer and use it in GitHub Desktop.
Save luxerama/2038069 to your computer and use it in GitHub Desktop.
Batman Category Problem
edit: (params) ->
@set 'channel', Ems.Channel.find parseInt(params.id), (err) -> throw err if err
Ems.Category.load (err, categories) =>
throw err if err
@set 'categories', categories
console.log 'Categories returned: ', categories
# RETURNS:
#
# > Categories returned: [ Category, Category, Category ]
@get("channel").get("categories").load (err, cats) =>
throw err if err
console.log 'Categories length: ', cats.length
console.log 'Channel categories loaded: ', @get('channel.categories.loaded')
# RETURNS:
#
# > Categories length: 0
# > Channel categories loaded: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment