[Solar-talk] new model & a many to many question

Rodrigo Moraes rodrigo.moraes at gmail.com
Wed Mar 14 21:23:35 PDT 2007


On 3/15/07, Paul M Jones wrote:
> Same thing holds true for "through" -- you can set the virtual
> "through_key" options and it'll set the right foreign/native options
> for you.
>
> Hope that all makes sense.

more or less. I tried some combinations but couldn't get it working
using *_key. but I replaced all *_col by *_key blindly and it didn't
found the column definition for the through model in the relationship
and then presumed a wrong name; how the relationships below would be
then?

platform
   has_many games2platforms
       foreign_model games2platforms
       foreign_col platform_id
   has_many games
       foreign_model game
       foreign_col id
       through games2platforms
       through_foreign_col game_id

it's no problem anyway because using *_col seems clear to me and works
perfectly.

rodrigo


More information about the solar-talk mailing list