Created
September 30, 2015 22:05
-
-
Save trabus/f3c3419b39ca55c418a0 to your computer and use it in GitHub Desktop.
Installing multiple blueprints from another blueprint
This file contains hidden or 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
var RSVP = require('rsvp'); | |
var assign = require('lodash/object/assign'); | |
module.exports = { | |
description: '', | |
// creates an array of blueprints to install, for instance scaffolding | |
install: function(options){ | |
var blueprints = [ | |
{ blueprint: this.lookupBlueprint('account'), | |
options: options | |
}, | |
{ blueprint: this.lookupBlueprint('user'), | |
options: assign({entity: { | |
name: options.entity.name // transform or modify options here, entity name for instance | |
}, | |
options) | |
} | |
]; | |
var installs = blueprints.map(function(b) { | |
b.blueprint.install(b.options); | |
}); | |
return RSVP.all(installs); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment