Skip to content

Commit

Permalink
Don't always wipe a Model's _schema property when calling setSource()
Browse files Browse the repository at this point in the history
Only wipe the internal schema cache if listSources() returned a useful
list of sources. Otherwise retain the old schema. This lets datasources
that don't implement listSources to be combined with models that define
static schema properties.

Fixes #2467
  • Loading branch information
markstory committed Dec 16, 2013
1 parent ef899f0 commit 01be15d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Cake/Model/Model.php
Expand Up @@ -1140,7 +1140,9 @@ public function setSource($tableName) {
));
}

$this->_schema = null;
if ($sources) {
$this->_schema = null;
}
}

$this->table = $this->useTable = $tableName;
Expand Down

0 comments on commit 01be15d

Please sign in to comment.