Move the _operations={} up

This commit is contained in:
Raymond Feng 2013-06-18 14:44:30 -07:00
parent 72e8e7230f
commit 3b731b1a12
1 changed files with 6 additions and 3 deletions

View File

@ -55,6 +55,11 @@ function DataSource(name, settings) {
return new DataSource(name, settings); return new DataSource(name, settings);
} }
ModelBuilder.call(this, arguments); ModelBuilder.call(this, arguments);
// operation metadata
// Initialize it before calling setup as the adapter might register operations
this._operations = {};
this.setup(name, settings); this.setup(name, settings);
// connector // connector
@ -64,8 +69,6 @@ function DataSource(name, settings) {
this.DataAccessObject = (connector && connector.DataAccessObject) ? connector.DataAccessObject : this.constructor.DataAccessObject; this.DataAccessObject = (connector && connector.DataAccessObject) ? connector.DataAccessObject : this.constructor.DataAccessObject;
this.DataAccessObject.call(this, arguments); this.DataAccessObject.call(this, arguments);
// operation metadata
this._operations = {};
// define DataAccessObject methods // define DataAccessObject methods
Object.keys(this.DataAccessObject).forEach(function (name) { Object.keys(this.DataAccessObject).forEach(function (name) {