Hello all,

I've been using cakephp for a few months now and I love it!! I must
admit I am still getting used to some of the concepts. At the moment
I'm trying to add a database bridging table for a HasAndBelongsToMany
Model. My three models involved are Users, Votes and Users_Votes.

So when I call the view /users_votes/create/ I get the error message


Missing Database Table
Error: Database table user_votes for model UserVote was not found.
Notice: If you want to customize this error message, create app/views/
errors/missing_table.ctp


I am using Cakephp 1.3.

- My database names are Users, Votes and Users_Votes
- My model names are user, vote, and uservote
- I think I have my models correct

class User extends AppModel
{
    var $name = 'User';

         var $hasAndBelongsToMany = array(
        'UserVote' => array(
                'className' => 'UserVote',
                'foreignKey' => 'user_id',
                'dependent' => true
        )
    );
}

class UserVote extends AppModel
{
    var $name = 'UserVote';

        var $belongsTo = array
        (
        'Vote' => array
                (
               'className'  => 'Vote',
               'foreignKey' => 'id'
        )
    );
}

class Vote extends AppModel
{
    var $name = 'Vote';

        var $hasAndBelongsToMany = array
        (
        'UserVote' => array(
                'className' => 'UserVote',
                'foreignKey' => 'vote_id',
                                'dependent' => true
        )
    );
}




Thanks!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
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