Fixing error when no connection is specified and

bake fixture Foo is used.
This commit is contained in:
mark_story 2009-05-07 23:59:43 -04:00
parent 37d81cb92d
commit fd5b422357

View file

@ -79,11 +79,14 @@ class FixtureTask extends Shell {
} }
if (isset($this->args[0])) { if (isset($this->args[0])) {
if (!isset($this->connection)) {
$this->connection = 'default';
}
if (strtolower($this->args[0]) == 'all') { if (strtolower($this->args[0]) == 'all') {
return $this->all(); return $this->all();
} }
$model = Inflector::camelize($this->args[0]); $model = Inflector::camelize($this->args[0]);
return $this->bake($model); $this->bake($model);
} }
} }
@ -94,9 +97,6 @@ class FixtureTask extends Shell {
* @return void * @return void
**/ **/
function all() { function all() {
if (!isset($this->connection)) {
$this->connection = 'default';
}
$this->interactive = false; $this->interactive = false;
$tables = $this->Model->listAll($this->connection, false); $tables = $this->Model->listAll($this->connection, false);
foreach ($tables as $table) { foreach ($tables as $table) {