Fix issue where bake was missing habtm associations
Fix issue where bake was missing habtm associations

If the current model is not the first table, habtm associations would be
missed. This was caused by eff4004261a2bd05e4df54ee2af057c680ff50fc

Refs #3532
Fixes #3605

tenkoma/cakephp,jerems02/cakephp,CVO-Technologies/cakephp,kumamidori/cakephp,justinyost/cakephp,et304383/passbolt_api,mvdriel/cakephp,khoimt/cakephp-study,michaelze/cakephp,thinkingmedia/cakephp,CVO-Technologies/cakephp,tgr0ss/cakephp,jeffblack360/cakephp,berrygoudswaard/cakephp,web-player/cakephp,pbaire/cakephp,tisu2tisu/cakephp,jjj117/cakephp,bravo-kernel/cakephp,dkarvounaris/cakephp,erikfig/cakephp,berrygoudswaard/cakephp,garethellis36/cakephp,jerems02/cakephp,mvdriel/cakephp,burriko/cakephp,dkarvounaris/cakephp,burriko/cakephp,justinyost/cakephp,et304383/passbolt_api,kumamidori/cakephp,ADmad/cakephp,yinhe007/cakephp,elboletaire/cakephp,jjj117/cakephp,tisu2tisu/cakephp,adopico/cakephp,eryw/cakephp,petteyg/cakephp,tenkoma/cakephp,ADmad/cakephp,timhoeppner/cakephp,CakeDC/cakephp,thinkingmedia/cakephp,jjj117/cakephp,ndm2/cakephp,adopico/cakephp,erikfig/cakephp,ADmad/cakephp,Balachan27/cakephp,cakephp-fr/cakephp,HavokInspiration/cakephp,akintoey/cakephp,garethellis36/cakephp,cakephp-fr/cakephp,adopico/cakephp,cakephp-fr/cakephp,eryw/cakephp,eboominathan/cakephp,yinhe007/cakephp,davidyell/cakephp,ionas/cakephp,jeffblack360/cakephp,Phillaf/cakephp,ndm2/cakephp,CakeDC/cakephp,michaelze/cakephp,jeffblack360/cakephp,akintoey/cakephp,eboominathan/cakephp,tgr0ss/cakephp,petteyg/cakephp,HavokInspiration/cakephp,et304383/passbolt_api,kumamidori/cakephp,cakephp/cakephp,ionas/cakephp,michaelze/cakephp,tenkoma/cakephp,yinhe007/cakephp,Balachan27/cakephp,tenkoma/cakephp,davidyell/cakephp,petteyg/cakephp,nrother/cakephp,dakota/cakephp,gmponos/cakephp,et304383/passbolt_api,timhoeppner/cakephp,cakephp/cakephp,mvdriel/cakephp,justinyost/cakephp,Balachan27/cakephp,bravo-kernel/cakephp,CakeDC/cakephp,cakephp/cakephp,garethellis36/cakephp,dakota/cakephp,tgr0ss/cakephp,timhoeppner/cakephp,davidyell/cakephp,Phillaf/cakephp,elboletaire/cakephp,khoimt/cakephp-study,dakota/cakephp,cakephp/cakephp,burriko/cakephp,ndm2/cakephp,mvdriel/cakephp,CVO-Technologies/cakephp,eboominathan/cakephp,HavokInspiration/cakephp,erikfig/cakephp,CakeDC/cakephp,ndm2/cakephp,berrygoudswaard/cakephp,garethellis36/cakephp,ionas/cakephp,eryw/cakephp,pbaire/cakephp,dkarvounaris/cakephp,dakota/cakephp,thinkingmedia/cakephp,nrother/cakephp,bravo-kernel/cakephp,et304383/passbolt_api,web-player/cakephp,akintoey/cakephp,elboletaire/cakephp,nrother/cakephp,tisu2tisu/cakephp,ADmad/cakephp,petteyg/cakephp,jerems02/cakephp,gmponos/cakephp,khoimt/cakephp-study,pbaire/cakephp,Phillaf/cakephp,web-player/cakephp,gmponos/cakephp