Skip to content

Commit

Permalink
Making bake model.ctp only include the association comment when there…
Browse files Browse the repository at this point in the history
… is a non empty association. Fixes #393
  • Loading branch information
markstory committed Feb 25, 2010
1 parent 48cd4d5 commit 9632e74
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cake/console/templates/default/classes/model.ctp
Expand Up @@ -56,9 +56,15 @@ if (!empty($validate)):
echo "\t);\n";
endif;

foreach ($associations as $assoc):
if (!empty($assoc)):
?>
//The Associations below have been created with all possible keys, those that are not needed can be removed
<?php
break;
endif;
endforeach;

foreach (array('hasOne', 'belongsTo') as $assocType):
if (!empty($associations[$assocType])):
$typeCount = count($associations[$assocType]);
Expand Down

0 comments on commit 9632e74

Please sign in to comment.