Skip to content

Commit

Permalink
explicitly set sails.models namespace in hooks.orm.configure
Browse files Browse the repository at this point in the history
  • Loading branch information
tjwebb committed Jul 16, 2015
1 parent 0a1dd6f commit 97780ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/hooks/orm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module.exports = function(sails) {
},

configure: function() {
sails.models = { };

// Backwards compatibilty
sails.config = backwardsCompatibleConfig(sails.config);
Expand Down
2 changes: 1 addition & 1 deletion lib/hooks/orm/load-user-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = function howto_lookupUserModules (sails) {
// Case-insensitive, using filename to determine identity
sails.modules.loadModels(function modulesLoaded(err, modules) {
if (err) return cb(err);
sails.models = _.extend(sails.models || {}, modules);
sails.models = _.extend(sails.models, modules);
return cb();
});
},
Expand Down

0 comments on commit 97780ae

Please sign in to comment.