Skip to content

Commit

Permalink
Revert "Making Model::setSource() eager again to fix issues where joi…
Browse files Browse the repository at this point in the history
…ned models"

This reverts commit d20f68c.
  • Loading branch information
lorenzo committed Feb 23, 2011
1 parent 6426b7e commit a79877d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cake/libs/model/model.php
Expand Up @@ -465,14 +465,16 @@ function __construct($id = false, $table = null, $ds = null) {
$this->Behaviors = new BehaviorCollection();

if ($this->useTable !== false) {

if ($this->useTable === null) {
$this->useTable = Inflector::tableize($this->name);
}
$this->setSource($this->useTable);

if ($this->displayField == null) {
unset($this->displayField);
}
$this->table = $this->useTable;
$this->tableToModel[$this->table] = $this->alias;
} elseif ($this->table === false) {
$this->table = Inflector::tableize($this->name);
}
Expand Down

0 comments on commit a79877d

Please sign in to comment.