Skip to content

Instantly share code, notes, and snippets.

@trabus
Created September 30, 2015 22:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trabus/f3c3419b39ca55c418a0 to your computer and use it in GitHub Desktop.
Save trabus/f3c3419b39ca55c418a0 to your computer and use it in GitHub Desktop.
Installing multiple blueprints from another blueprint
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