Honor the model plural name

This commit is contained in:
Raymond Feng 2013-10-25 16:25:05 -07:00
parent c3d7fd0f1c
commit 2ae0fd8804
1 changed files with 1 additions and 2 deletions

View File

@ -41,8 +41,7 @@ Relation.hasMany = function hasMany(anotherClass, params) {
} }
} }
} }
var methodName = params.as || var methodName = params.as || i8n.camelize(anotherClass.pluralModelName, true);
i8n.camelize(i8n.pluralize(anotherClass.modelName), true);
var fk = params.foreignKey || i8n.camelize(thisClassName + '_id', true); var fk = params.foreignKey || i8n.camelize(thisClassName + '_id', true);
this.relations[methodName] = { this.relations[methodName] = {