Making bake model.ctp only include the association comment when there is a non empty association. Fixes #393

This commit is contained in:
Mark Story 2010-02-24 22:23:09 -05:00
parent 48cd4d5738
commit 9632e74cfc

View file

@ -56,9 +56,15 @@ if (!empty($validate)):
echo "\t);\n"; echo "\t);\n";
endif; 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 //The Associations below have been created with all possible keys, those that are not needed can be removed
<?php <?php
break;
endif;
endforeach;
foreach (array('hasOne', 'belongsTo') as $assocType): foreach (array('hasOne', 'belongsTo') as $assocType):
if (!empty($associations[$assocType])): if (!empty($associations[$assocType])):
$typeCount = count($associations[$assocType]); $typeCount = count($associations[$assocType]);