Skip to content

Commit

Permalink
code styles/comments cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tjwebb committed Jul 16, 2015
1 parent 97780ae commit 70246d4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 40 deletions.
31 changes: 1 addition & 30 deletions lib/hooks/orm/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/**
* Module dependencies.
*/

var _ = require('lodash');
var async = require('async');
var prompt = require('prompt');
Expand All @@ -11,8 +7,6 @@ var howto_buildORM = require('./build-orm');
var howto_backwardsCompatibleConfig = require('./backwards-compatibility/upgrade-sails.config');
var howto_backwardsCompatibleDatastore = require('./backwards-compatibility/upgrade-datastore');



module.exports = function(sails) {

// Hydrate freeze-dried (context-free) modules using the sails app instance
Expand All @@ -21,13 +15,10 @@ module.exports = function(sails) {
var normalizeModelDef = howto_normalizeModelDef(sails);
var buildORM = howto_buildORM(sails);



/**
* Hook definition
*/

var hook = {
return {

defaults: {

Expand Down Expand Up @@ -70,7 +61,6 @@ module.exports = function(sails) {
sails.once('lower', hook.teardown);
},


////////////////////////////////////////////////////////////////////////////
// NOTE: If a user hook needs to add or modify model definitions,
// the hook should wait until `hook:orm:loaded`, then reload the original
Expand Down Expand Up @@ -180,20 +170,6 @@ module.exports = function(sails) {
},600);
});

// async.eachSeries(_.keys(sails.models), function (identity, nextModel) {
// // If migrate setting is defined, continue without doing anything else.
// if (typeof sails.models[identity].migrate !== 'undefined') {
// return nextModel();
// }

// // If migrate setting is not specififed on this model,
// // display a prompt and require the user to make a decision about
// // their migration strategy.
// var thisModel = sails.models[identity];

// }, next);


}],

// Once all user model and adapter definitions are loaded
Expand All @@ -207,7 +183,6 @@ module.exports = function(sails) {
}, cb);
},


// Reload ORM hook
// (which mostly just runs the hook's `initialize()` fn again)
reload: function () {
Expand All @@ -230,7 +205,6 @@ module.exports = function(sails) {
});
},


// Teardown ORM hook
teardown: function (cb) {
cb = cb || function(err) {
Expand All @@ -249,7 +223,4 @@ module.exports = function(sails) {
}, cb);
}
};

return hook;

};
10 changes: 0 additions & 10 deletions lib/hooks/orm/load-user-modules.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
/**
* Module dependencies.
*/

var _ = require('lodash');
var async = require('async');


module.exports = function howto_lookupUserModules (sails) {

return function lookupUserModules (cb) {
Expand All @@ -16,8 +11,6 @@ module.exports = function howto_lookupUserModules (sails) {
models: function(cb) {
sails.log.verbose('Loading app models...');

// sails.models = {};

// Load app's model definitions
// Case-insensitive, using filename to determine identity
sails.modules.loadModels(function modulesLoaded(err, modules) {
Expand All @@ -30,8 +23,6 @@ module.exports = function howto_lookupUserModules (sails) {
adapters: function(cb) {
sails.log.verbose('Loading app adapters...');

// sails.adapters = {};

// Load custom adapters
// Case-insensitive, using filename to determine identity
sails.modules.loadAdapters(function modulesLoaded(err, modules) {
Expand All @@ -43,5 +34,4 @@ module.exports = function howto_lookupUserModules (sails) {

}, cb);
};

};

0 comments on commit 70246d4

Please sign in to comment.