Re: problem on belongsTo many models

2007-02-07 Thread exiang
Nop, it doesn't work. As i understand, belongsTo will create a join table in sql. However, in this case, an equipment can belongs to a school or an area, but not both On Feb 8, 1:37 am, "RichardAtHome" <[EMAIL PROTECTED]> wrote: > If I'm understanding correctly: > > You will need to set up t

Re: problem on belongsTo many models

2007-02-07 Thread RichardAtHome
If I'm understanding correctly: You will need to set up two associations: in model equipment: $belongsTo = array('school', 'area'); (make sure the school and area arguments above appear in the same order as their school_id and area_id in the table) On a related note, I'm not sure that's the b

problem on belongsTo many models

2007-02-06 Thread exiang
Here is the scenario: 1) An Area have many schools A school belongs to an area 2) A school have many equipments An area have many equipments too Thus, an equipment can belongs to either a school or an area (as in belongs to the office of the area that govern all school) 3) i have db table and m