Created
May 8, 2016 18:45
-
-
Save vorandrew/f9ff2cdff3a61abf5563813feaa45bdc to your computer and use it in GitHub Desktop.
More eloquent way to do this?
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
yield Promise.map data, (oneEvent)-> | |
eventModel = new Event oneEvent | |
eventModel.fetch().then (fromDB) -> | |
return do eventModel.save if not fromDB? | |
fromDB.save oneEvent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment