Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

skipTables for ControllerTask and ViewTask #347

Closed
wants to merge 4 commits into
from
Jump to file or symbol
Failed to load files and symbols.
+21 −1
Split
@@ -41,6 +41,13 @@ class ControllerTask extends BakeTask {
*/
public $path = null;
+/**
+ * Tables to skip when running all()
+ *
+ * @var array
+ */
+ public $skipTables = array('cake_sessions', 'i18n');
+
/**
* Override initialize
*
@@ -106,6 +113,9 @@ public function all() {
ClassRegistry::config('Model', array('ds' => $this->connection));
$unitTestExists = $this->_checkUnitTest();
foreach ($this->__tables as $table) {
+ if (in_array($table, $this->skipTables)) {
+ continue;
+ }
$model = $this->_modelName($table);
$controller = $this->_controllerName($model);
App::uses($model, 'Model');
@@ -48,7 +48,7 @@ class ModelTask extends BakeTask {
*
* @var array
*/
- public $skipTables = array('i18n');
+ public $skipTables = array('cake_sessions', 'i18n');
/**
* Holds tables found on connection.
@@ -70,6 +70,13 @@ class ViewTask extends BakeTask {
*/
public $noTemplateActions = array('delete');
+/**
+ * Tables to skip when running all()
+ *
+ * @var array
+ */
+ public $skipTables = array('cake_sessions', 'i18n');
+
/**
* Override initialize
*
@@ -174,6 +181,9 @@ public function all() {
}
$this->interactive = false;
foreach ($tables as $table) {
+ if (in_array($table, $this->skipTables)) {
+ continue;
+ }
$model = $this->_modelName($table);
$this->controllerName = $this->_controllerName($model);
App::uses($model, 'Model');