From 0fce343846c1c9afcb7afee12d8651215cd6d8cf Mon Sep 17 00:00:00 2001 From: antograssiot Date: Thu, 20 Aug 2015 08:12:11 +0200 Subject: [PATCH] used only unkipped models in bake all --everything jus a small refactoring to avoid maintaining the list of table to be skipped in two places. --- src/Shell/BakeShell.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Shell/BakeShell.php b/src/Shell/BakeShell.php index 4214195fc..f6a006d63 100644 --- a/src/Shell/BakeShell.php +++ b/src/Shell/BakeShell.php @@ -225,7 +225,7 @@ public function all($name = null) if (empty($name) && !$this->param('everything')) { $this->Model->connection = $this->connection; $this->out('Possible model names based on your database:'); - foreach ($this->Model->listAll() as $table) { + foreach ($this->Model->listUnskipped() as $table) { $this->out('- ' . $table); } $this->out('Run `cake bake all [name]` to generate skeleton files.'); @@ -237,11 +237,7 @@ public function all($name = null) if ($this->param('everything')) { $this->Model->connection = $this->connection; - $allTables = collection($this->Model->listAll()); - $filteredTables = $allTables->reject(function ($tableName) { - $ignoredTables = ['i18n', 'cake_sessions', 'phinxlog', 'users_phinxlog']; - return in_array($tableName, $ignoredTables); - }); + $filteredTables = collection($this->Model->listUnskipped()); } $filteredTables->each(function ($tableName) {