Merge remote-tracking branch 'origin/2.0' into 2.1

This commit is contained in:
Jose Lorenzo Rodriguez 2012-01-22 15:52:54 -04:30
commit b9ad469a65
5 changed files with 16 additions and 1 deletions

View file

@ -1274,7 +1274,7 @@ class Model extends Object implements CakeEventListener {
* @return array Array of table metadata
*/
public function schema($field = false) {
if (!is_array($this->_schema) || $field === true) {
if ($this->useTable !== false && (!is_array($this->_schema) || $field === true)) {
$db = $this->getDataSource();
$db->cacheSources = ($this->cacheSources && $db->cacheSources);
if (method_exists($db, 'describe') && $this->useTable !== false) {