From 2ae0fd880421ea442eee820fc865f04ec317804e Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Fri, 25 Oct 2013 16:25:05 -0700 Subject: [PATCH] Honor the model plural name --- lib/relations.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/relations.js b/lib/relations.js index bb2f520e..2f13cb99 100644 --- a/lib/relations.js +++ b/lib/relations.js @@ -41,8 +41,7 @@ Relation.hasMany = function hasMany(anotherClass, params) { } } } - var methodName = params.as || - i8n.camelize(i8n.pluralize(anotherClass.modelName), true); + var methodName = params.as || i8n.camelize(anotherClass.pluralModelName, true); var fk = params.foreignKey || i8n.camelize(thisClassName + '_id', true); this.relations[methodName] = {