Fixing Eloquent constructor bug.

Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
This commit is contained in:
Taylor Otwell 2012-03-29 22:04:04 -05:00
parent 15982efd11
commit b5dd77d387
3 changed files with 15 additions and 3 deletions

View File

@ -2,11 +2,23 @@ ## Laravel Change Log
## Contents ## Contents
- [Laravel 3.1.2](#3.1.2)
- [Upgrading From 3.1.1](#upgrade-3.1.2)
- [Laravel 3.1.1](#3.1.1) - [Laravel 3.1.1](#3.1.1)
- [Upgrading From 3.1](#upgrade-3.1.1) - [Upgrading From 3.1](#upgrade-3.1.1)
- [Laravel 3.1](#3.1) - [Laravel 3.1](#3.1)
- [Upgrading From 3.0](#upgrade-3.1) - [Upgrading From 3.0](#upgrade-3.1)
<a name="3.1.2"></a>
## Laravel 3.1.2
- Fixes Eloquent query method constructor conflict.
<a name="upgrade-3.1.2"></a>
## Upgrade From 3.1.1
- Replace the **laravel** folder.
<a name="3.1.1"></a> <a name="3.1.1"></a>
## Laravel 3.1.1 ## Laravel 3.1.1

View File

@ -43,7 +43,7 @@ public function __construct($model)
{ {
$this->model = ($model instanceof Model) ? $model : new $model; $this->model = ($model instanceof Model) ? $model : new $model;
$this->table = $this->query(); $this->table = $this->table();
} }
/** /**
@ -245,7 +245,7 @@ protected function model_includes()
* *
* @return Query * @return Query
*/ */
protected function query() protected function table()
{ {
return $this->connection()->table($this->model->table()); return $this->connection()->table($this->model->table());
} }

View File

@ -51,7 +51,7 @@ public function __construct($model, $associated, $foreign)
// Next we'll set the fluent query builder for the relationship and // Next we'll set the fluent query builder for the relationship and
// constrain the query such that it only returns the models that // constrain the query such that it only returns the models that
// are appropriate for the relationship. // are appropriate for the relationship.
$this->table = $this->query(); $this->table = $this->table();
$this->constrain(); $this->constrain();
} }