Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@treygriffith
Created November 11, 2014 02:51
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 treygriffith/4b4383f6fd86b739bead to your computer and use it in GitHub Desktop.
Save treygriffith/4b4383f6fd86b739bead to your computer and use it in GitHub Desktop.
Saving an Ember record with an async belongsTo relationship
comment = @store.createRecord('comment', {
author: @get('currentUser')
# snip
})
comment.get('author').then ->
# comment.author is now resolved, safe to save
comment.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment