Commit 7af9e08a authored by Taylor Otwell's avatar Taylor Otwell

Refactoring Eloquent.

parent c4eb994f
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment