From 7af9e08a60f51769b10a3af30bf94f098af84ed7 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 8 Jul 2011 08:00:04 -0700 Subject: [PATCH] Refactoring Eloquent. --- system/db/eloquent.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/system/db/eloquent.php b/system/db/eloquent.php index 8b67cfea..a705cc5b 100644 --- a/system/db/eloquent.php +++ b/system/db/eloquent.php @@ -369,12 +369,7 @@ abstract class Eloquent { { $model = $this->$key(); - if (in_array($this->relating, array('has_one', 'belongs_to'))) - { - return $this->ignore[$key] = $model->first(); - } - - return $this->ignore[$key] = $model->get(); + return $this->ignore[$key] = (in_array($this->relating, array('has_one', 'belongs_to'))) ? $model->first() : $model->get(); } return (array_key_exists($key, $this->attributes)) ? $this->attributes[$key] : null;