Rename dataSource() to avoid conflicts with the property

This commit is contained in:
Raymond Feng 2013-07-23 12:44:04 -07:00
parent 4df5a02676
commit 1970c99424
1 changed files with 8 additions and 8 deletions

View File

@ -28,7 +28,7 @@ BaseSQL.prototype.queryOne = function (sql, callback) {
* @param model The model name
* @returns {DataSource} The data source
*/
BaseSQL.prototype.dataSource = function(model) {
BaseSQL.prototype.getDataSource = function(model) {
var m = this._models[model];
if(!m) {
console.trace('Model not found: ' + model);
@ -42,7 +42,7 @@ BaseSQL.prototype.dataSource = function(model) {
* @returns {String} The table name
*/
BaseSQL.prototype.table = function (model) {
var name = this.dataSource(model).tableName(model);
var name = this.getDataSource(model).tableName(model);
var dbName = this.dbName;
if(typeof dbName === 'function') {
name = dbName(name);
@ -57,7 +57,7 @@ BaseSQL.prototype.table = function (model) {
* @returns {String} The column name
*/
BaseSQL.prototype.column = function (model, property) {
var name = this.dataSource(model).columnName(model, property);
var name = this.getDataSource(model).columnName(model, property);
var dbName = this.dbName;
if(typeof dbName === 'function') {
name = dbName(name);
@ -72,7 +72,7 @@ BaseSQL.prototype.column = function (model, property) {
* @returns {Object} The column metadata
*/
BaseSQL.prototype.columnMetadata = function (model, property) {
return this.dataSource(model).columnMetadata(model, property);
return this.getDataSource(model).columnMetadata(model, property);
};
/**
@ -97,7 +97,7 @@ BaseSQL.prototype.propertyName = function (model, column) {
* @returns {String} The id property name
*/
BaseSQL.prototype.idName = function (model) {
return this.dataSource(model).idName(model);
return this.getDataSource(model).idName(model);
};
/**
@ -106,7 +106,7 @@ BaseSQL.prototype.idName = function (model) {
* @returns {[String]} The id property names
*/
BaseSQL.prototype.idNames = function (model) {
return this.dataSource(model).idNames(model);
return this.getDataSource(model).idNames(model);
};
/**
@ -115,7 +115,7 @@ BaseSQL.prototype.idNames = function (model) {
* @returns {String} The column name
*/
BaseSQL.prototype.idColumn = function (model) {
var name = this.dataSource(model).idColumnName(model);;
var name = this.getDataSource(model).idColumnName(model);;
var dbName = this.dbName;
if(typeof dbName === 'function') {
name = dbName(name);
@ -129,7 +129,7 @@ BaseSQL.prototype.idColumn = function (model) {
* @returns {String} the escaped id column name
*/
BaseSQL.prototype.idColumnEscaped = function (model) {
return this.escapeName(this.dataSource(model).idColumnName(model));
return this.escapeName(this.getDataSource(model).idColumnName(model));
};
/**