From aed1b08019c9e3f6b60c66c8e3c99530b728bed4 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 29 Dec 2008 23:31:22 +0000 Subject: Updated to Kohana r3849 --- kohana/libraries/ORM.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'kohana/libraries') diff --git a/kohana/libraries/ORM.php b/kohana/libraries/ORM.php index 99a8dc4f..51b6069c 100644 --- a/kohana/libraries/ORM.php +++ b/kohana/libraries/ORM.php @@ -901,9 +901,16 @@ class ORM_Core { * @return boolean */ public function has(ORM $model) - { - // Get the plural object name as the related name - $related = $model->object_plural; + { + if ($model->table_names_plural) + { + // Get the plural object name as the related name + $related = $model->object_plural; + } + else + { + $related = $model->object_name; + } if (($join_table = array_search($related, $this->has_and_belongs_to_many)) === FALSE) return FALSE; -- cgit v1.2.3