From 214bc3964859b5f391a53e4c2f1fb67b28f2f3de Mon Sep 17 00:00:00 2001 From: Deon George Date: Sun, 26 Jun 2011 22:19:53 +1000 Subject: [PATCH] Upstream Patch: ORM enhancements for PTA --- includes/kohana/modules/orm/classes/kohana/orm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/kohana/modules/orm/classes/kohana/orm.php b/includes/kohana/modules/orm/classes/kohana/orm.php index be9a2e8..b5ef1e2 100644 --- a/includes/kohana/modules/orm/classes/kohana/orm.php +++ b/includes/kohana/modules/orm/classes/kohana/orm.php @@ -384,7 +384,7 @@ class Kohana_ORM extends Model implements serializable { foreach ($this->_has_many as $alias => $details) { - $defaults['model'] = Inflector::singular($alias); + $defaults['model'] = $this->_model_names_plural ? Inflector::singular($alias) : $alias; $defaults['foreign_key'] = $this->_object_name.$this->_foreign_key_suffix; $defaults['through'] = NULL; $defaults['far_key'] = Inflector::singular($alias).$this->_foreign_key_suffix;