summaryrefslogtreecommitdiff
path: root/kohana/libraries/ORM.php
diff options
context:
space:
mode:
Diffstat (limited to 'kohana/libraries/ORM.php')
-rw-r--r--kohana/libraries/ORM.php13
1 files changed, 10 insertions, 3 deletions
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;