lib/Plugin.js
function() {
			_.each(Bulkhead, function(bulkhead, bulkheadName) {
				// A registered Bulkhead package needs to be initiated, bound to the Sails instance, detached, and merged back into the Bulkhead
				_.each(bulkhead.models, function(model, index) {
					bulkhead.models[model.originalIdentity] = sails.models[model.identity];
					bulkhead[model.originalGlobalId] = bulkhead.models[model.originalIdentity];
					delete model.originalIdentity;
					delete model.originalGlobalId;
				});
	
				_.each(bulkhead.services, function(service, index) {
					service.plugin = bulkhead;
					bulkhead[service.originalIdentity] = bulkhead.services[index];
					delete service.originalIdentity;
				});
				
				sails.log.silly(Object.keys(bulkhead.models).length + ' loaded from the ' + path.basename(bulkheadName) + ' package...');
			});
			
			sails.removeListener('hook:orm:reloaded', reloadedEvent);
			sails.modules.loadModels = detachedLoadModels;
			loaded = true;
			sails.log.silly('Bulkhead packages are active.');
			done();
		}
function() {
			_.each(Bulkhead, function(bulkhead, bulkheadName) {
				// A registered Bulkhead package needs to be initiated, bound to the Sails instance, detached, and merged back into the Bulkhead
				_.each(bulkhead.models, function(model, index) {
					bulkhead.models[model.originalIdentity] = sails.models[model.identity];
					bulkhead[model.originalGlobalId] = bulkhead.models[model.originalIdentity];
					delete model.originalIdentity;
					delete model.originalGlobalId;
				});
	
				_.each(bulkhead.services, function(service, index) {
					service.plugin = bulkhead;
					bulkhead[service.originalIdentity] = bulkhead.services[index];
					delete service.originalIdentity;
				});
				
				sails.log.silly(Object.keys(bulkhead.models).length + ' loaded from the ' + path.basename(bulkheadName) + ' package...');
			});
			
			sails.removeListener('hook:orm:reloaded', reloadedEvent);
			sails.modules.loadModels = detachedLoadModels;
			loaded = true;
			sails.log.silly('Bulkhead packages are active.');
			done();
		}
function ( ) { _ . each ( Bulkhead , function ( bulkhead , bulkheadName ) { // A registered Bulkhead package needs to be initiated, bound to the Sails instance, detached, and merged back into the Bulkhead _ . each ( bulkhead . models , function ( model , index ) { bulkhead . models [ model . originalIdentity ] = sails . models [ model . identity ] ; bulkhead [ model . originalGlobalId ] = bulkhead . models [ model . originalIdentity ] ; delete model . originalIdentity ; delete model . originalGlobalId ; } ) ; _ . each ( bulkhead . services , function ( service , index ) { service . plugin = bulkhead ; bulkhead [ service . originalIdentity ] = bulkhead . services [ index ] ; delete service . originalIdentity ; } ) ; sails . log . silly ( Object . keys ( bulkhead . models ) . length + ' loaded from the ' + path . basename ( bulkheadName ) + ' package...' ) ; } ) ; sails . removeListener ( 'hook:orm:reloaded' , reloadedEvent ) ; sails . modules . loadModels = detachedLoadModels ; loaded = true ; sails . log . silly ( 'Bulkhead packages are active.' ) ; done ( ) ; }
Reload event that loads each Bulkhead package's models
Reload event that loads each Bulkhead package s models