Skip to content

Commit

Permalink
Fixing fatal errors when running postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Sep 3, 2011
1 parent df303f9 commit 783b5d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions lib/Cake/Model/Datasource/DataSource.php
Expand Up @@ -114,14 +114,18 @@ public function listSources($data = null) {
/**
* Returns a Model description (metadata) or null if none found.
*
* @param Model $model
* @param Model|string $model
* @return array Array of Metadata for the $model
*/
public function describe(Model $model) {
public function describe($model) {
if ($this->cacheSources === false) {
return null;
}
$table = $model->tablePrefix . $model->table;
if (is_string($model)) {
$table = $model;
} else {
$table = $model->tablePrefix . $model->table;
}

if (isset($this->_descriptions[$table])) {
return $this->_descriptions[$table];
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Model/Datasource/Database/Postgres.php
Expand Up @@ -186,7 +186,7 @@ public function listSources($data = null) {
* @param Model $model Name of database table to inspect
* @return array Fields in table. Keys are name and type
*/
public function describe(Model $model) {
public function describe($model) {
$fields = parent::describe($model);
$table = $this->fullTableName($model, false);
$this->_sequenceMap[$table] = array();
Expand Down

0 comments on commit 783b5d4

Please sign in to comment.