From b5989e907ef394056fb7b92c05ebedfdcf18eb25 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= <miroslav@strongloop.com>
Date: Tue, 22 Jul 2014 10:57:44 +0200
Subject: [PATCH 1/2] package: update dependency versions

---
 package.json | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package.json b/package.json
index 7a9002c..1390b50 100644
--- a/package.json
+++ b/package.json
@@ -24,7 +24,7 @@
   },
   "dependencies": {
     "commondir": "0.0.1",
-    "debug": "^0.8.1",
+    "debug": "^1.0.4",
     "lodash.clonedeep": "^2.4.1",
     "semver": "^2.3.0",
     "toposort": "^0.2.10",
@@ -33,9 +33,9 @@
   "devDependencies": {
     "loopback": "^1.5.0",
     "mocha": "^1.19.0",
-    "must": "^0.11.0",
+    "must": "^0.12.0",
     "supertest": "^0.13.0",
-    "fs-extra": "^0.9.1",
+    "fs-extra": "^0.10.0",
     "browserify": "^4.1.8"
   }
 }

From c4b09c6b7aaa4c1a1a980ac776455cafc5c295a0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= <miroslav@strongloop.com>
Date: Tue, 22 Jul 2014 10:58:18 +0200
Subject: [PATCH 2/2] executor: remove `Base` arg from model function

Simplify the contract for functions exported by `models/*.js` files
by removing the second argument `Base`. The base class can be accessed
using `ModelCtor.base`.

An updated example of a model js file:

```js
module.exports = function(Customer) {
  Customer.setup = function() {
    Customer.base.setup.apply(this, arguments);
    // etc.
  };
};
```
---
 lib/executor.js                              | 3 +--
 test/executor.test.js                        | 4 ++--
 test/fixtures/browser-app/models/customer.js | 4 ++--
 3 files changed, 5 insertions(+), 6 deletions(-)

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';
 };