Skip to content

Commit

Permalink
Fixing Eloquent constructor bug.
Browse files Browse the repository at this point in the history
Signed-off-by: Taylor Otwell <[email protected]>
  • Loading branch information
taylorotwell committed Mar 30, 2012
1 parent 15982ef commit b5dd77d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,23 @@

## Contents

- [Laravel 3.1.2](#3.1.2)
- [Upgrading From 3.1.1](#upgrade-3.1.2)
- [Laravel 3.1.1](#3.1.1)
- [Upgrading From 3.1](#upgrade-3.1.1)
- [Laravel 3.1](#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>
## Laravel 3.1.1

Expand Down
4 changes: 2 additions & 2 deletions laravel/database/eloquent/query.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function __construct($model)
{
$this->model = ($model instanceof Model) ? $model : new $model;

$this->table = $this->query();
$this->table = $this->table();
}

/**
Expand Down Expand Up @@ -245,7 +245,7 @@ protected function model_includes()
*
* @return Query
*/
protected function query()
protected function table()
{
return $this->connection()->table($this->model->table());
}
Expand Down
2 changes: 1 addition & 1 deletion laravel/database/eloquent/relationships/relationship.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct($model, $associated, $foreign)
// Next we'll set the fluent query builder for the relationship and
// constrain the query such that it only returns the models that
// are appropriate for the relationship.
$this->table = $this->query();
$this->table = $this->table();

$this->constrain();
}
Expand Down

0 comments on commit b5dd77d

Please sign in to comment.