All of my underscored table names work just fine, but this is something I wonder about:
If both parts of the underscored table name are plural (users_votes) .. would the model be UsersVote or UserVote. Do both parts get singularized? In any case, your issue still seems to be with naming conventions. - Ed On Fri, Jun 11, 2010 at 5:43 PM, Jonathon Musters <[email protected]>wrote: > I think the new table should be called UsersVotes. No underscore. > > > > On 6/11/10, Andrew <[email protected]> wrote: > > 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]<cake-php%[email protected]>For > > more options, visit this group at > > http://groups.google.com/group/cake-php?hl=en > > > > 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]<cake-php%[email protected]>For > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > 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
