Skip to content

Commit

Permalink
Allow ORM\Table to slip through duplicate checks.
Browse files Browse the repository at this point in the history
When an automodel is involved we can't be certain it is bad so let it
through.
  • Loading branch information
markstory committed Sep 2, 2014
1 parent 3a18a0e commit a567437
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Shell/Task/TestTask.php
Expand Up @@ -337,8 +337,9 @@ protected function _processModel($subject) {
$assoc = $subject->association($alias);
$target = $assoc->target();
$name = $target->alias();
$subjectClass = get_class($subject);

if (get_class($subject) === get_class($target)) {
if ($subjectClass !== 'Cake\ORM\Table' && $subjectClass === get_class($target)) {
continue;
}

Expand Down
3 changes: 2 additions & 1 deletion src/Shell/Task/ViewTask.php
Expand Up @@ -444,7 +444,8 @@ protected function _associations(Table $model) {
$assocName = $assoc->name();
$alias = $target->alias();

if (get_class($target) === get_class($model)) {
$modelClass = get_class($model);
if ($modelClass !== 'Cake\ORM\Table' && get_class($target) === $modelClass) {
continue;
}

Expand Down

0 comments on commit a567437

Please sign in to comment.