I set my Debug to 2 to have a look at when Cake does joins in my app.
hasOne does a JOIN
belongsTo does a JOIN
hasMany just selects on the related table with a WHERE clause
HABTM does a few queries and things.

So, like you say, your find should work from $this->GamePlayer->find()
since it belongs to a Game.

This is all I can think of (all extreme longshots):
Trash all cache files. (in case Cake reads the schema form cache and
it is not up to date)
Download Cake again (just to make sure you are not running a nightly
with a bug in it of some really rare problem with the files)
Change the name of the "missing" field in MySQL. (No rational reason
for doing this really)
Make the association very explicit and define all the parameters you
can for Game (in case something does not match Cakes conventions)

good luck to you
/Martin


On Aug 21, 11:54 pm, Christian <[EMAIL PROTECTED]> wrote:
> Sorry, my mistake. A lot of tinkering and testing i copied the wrong
> things
> Game->find() says it can't find GamePlayer.user_id column which makes
> sense now because it doesn't do a join.
>
> however still having the problem where GamePlayer->find() says it
> can't find Game.status column, so still no join.
>
> my setup is as follows (i just verified to make sure i didn't slip up
> on simple naming):
>
> class GamePlayer extends AppModel {
>         var $name = 'GamePlayer';
>         var $belongsTo = array (
>                         'User',
>                         'Game'
>                                         );
>
> }
>
> database_name  (columns):
> games (id int(10) unsigned, status int(1),...)
> game_players (id int(10) unsigned, game_id int(11),...)
>
> another point, I'm doing this find() from within the games_controller.
> However i do have       var $uses = array('Game','User','GamePlayer',
> 'Rule', 'Weapon'); in the controller...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to