From a79877d11a911265731cac77297c36541902f62e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?= Date: Tue, 22 Feb 2011 23:49:02 -0430 Subject: [PATCH] Revert "Making Model::setSource() eager again to fix issues where joined models" This reverts commit d20f68c44ee6d0b8f7fe3e17cf28e7874a30d5bb. --- cake/libs/model/model.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 9b537a95cd0..4e64c20ce74 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -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); }