diff --git a/lib/executor.js b/lib/executor.js index 8a238dd..d04e833 100644 --- a/lib/executor.js +++ b/lib/executor.js @@ -156,8 +156,7 @@ function defineModels(app, instructions) { var code = require(data.sourceFile); if (typeof code === 'function') { debug('Customizing model %s', name); - // NOTE model.super_ is set by Node's util.inherits - code(model, model.super_); + code(model); } else { debug('Skipping model file %s - `module.exports` is not a function', data.sourceFile); diff --git a/test/executor.test.js b/test/executor.test.js index 08cddec..8c53715 100644 --- a/test/executor.test.js +++ b/test/executor.test.js @@ -56,9 +56,9 @@ describe('executor', function() { it('defines and customizes models', function() { appdir.writeFileSync('models/Customer.js', 'module.exports = ' + - function(Customer, Base) { + function(Customer) { Customer.settings._customized = 'Customer'; - Base.settings._customized = 'Base'; + Customer.base.settings._customized = 'Base'; }.toString()); boot.execute(app, someInstructions({ diff --git a/test/fixtures/browser-app/models/customer.js b/test/fixtures/browser-app/models/customer.js index dfb143e..79a512d 100644 --- a/test/fixtures/browser-app/models/customer.js +++ b/test/fixtures/browser-app/models/customer.js @@ -1,4 +1,4 @@ -module.exports = function(Customer, Base) { +module.exports = function(Customer) { Customer.settings._customized = 'Customer'; - Base.settings._customized = 'Base'; + Customer.base.settings._customized = 'Base'; };