From 1ae94784967f78afba0101cad9ee898cfb9bd8b3 Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Thu, 3 Oct 2013 14:49:03 -0700 Subject: [PATCH] Fix the columnName --- lib/datasource.js | 2 +- lib/model.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/datasource.js b/lib/datasource.js index 4e057629..d854bd95 100644 --- a/lib/datasource.js +++ b/lib/datasource.js @@ -1190,7 +1190,7 @@ DataSource.prototype.tableName = function (modelName) { * @returns {String} columnName */ DataSource.prototype.columnName = function (modelName, propertyName) { - return this.definitions[modelName].columnName(this.connector.name); + return this.definitions[modelName].columnName(this.connector.name, propertyName); }; /** diff --git a/lib/model.js b/lib/model.js index ec454050..8547d727 100644 --- a/lib/model.js +++ b/lib/model.js @@ -171,7 +171,7 @@ ModelBaseClass.defineProperty = function (prop, params) { }; ModelBaseClass.getPropertyType = function (propName) { - var prop = this.properties[propName]; + var prop = this.definition.properties[propName]; if(!prop) { // The property is not part of the definition return null;