Created
October 15, 2014 02:56
-
-
Save artburkart/440df9304827194b953a to your computer and use it in GitHub Desktop.
saving multiple records in ember
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
// Using the underscore library to loop | |
comments = _.map(ids, function (id) { | |
return self.store.createRecord('comment', { | |
date: new Date(), | |
owner: id, | |
type: 'Mailed Notice' | |
}); | |
}); | |
comments.invoke('save'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment