I found my error!

I was using plugin architecture so the model's correct name is
"plugin_name(dot)model_name"!!!

Please read this thread about this problem:
http://groups.google.it/group/cake-php/browse_thread/thread/8c750cd28f43225b?hl=it

Thanks to all!
Bye!



On 12 Mag, 09:11, MPeg <marco.pegor...@gmail.com> wrote:
> Hi to all bakers!
>
> I'm diving into Cake1.2 relations while building a demo ACL
> application (Just to learn about...)
>
> I'm creating a custom plugin to solve this issue so my tables have a
> custom name just to mantain order into db:
>
> Model "Yuser" -> Table "freyr_users"
> Model "Ypermission" -> Table "freyr_permissions"
>
> I built a join_table like:
>
> Table name: "freyr_objects_permissions"
> object_id | bigint (16)
> permission_id | bigint (16)
>
> I have set up my "Yuser <-> YPermission" HABTM relation this way:
>
> var $hasAndBelongsToMany = array(
>         'Ypermission' => array(
>                 'className'                     => 'Ypermission',
>                 'joinTable'                             => 
> 'freyr_objects_permissions',
>                 'foreignKey'                    => 'object_id',
>                 'associationForeignKey' => 'permission_id',
>         ),
> );
>
> This relation causes a "missing table" error because "Ypermission"
> model try to use a table named "ypermissions" (just using naming
> conventions)... It seems to ignore the "useTable" directive set into
> model.
>
> I have temporary solved this problem just renaming
> "freyr_ypermissions" into "ypermissions" but I want to use custom
> table names to maintain order in my db!
>
> Tables grows up every day!!!!
--~--~---------~--~----~------------~-------~--~----~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to