I have a vendors table that contains a field named "address_id" that
is a foreign key to addresses.id. If I define the models as shown
below then I'm unable to request a scaffolded version of /vendors/
without getting an error: "Unknown column 'Address.vendor_id' in 'on
clause'". I don't want a "vendor_id" in the addresses table because I
need to share that data with other tables later in the dev cycle (e.g.
the volunteers table).
class Vendor extends AppModel {
public $name = 'Vendor';
public $hasOne = array ( 'CommercialVendor', 'Address' );
}
class Address extends AppModel {
public $name = 'Address';
public $belongsTo = array ( 'Vendor' );
}
If I remove 'Address' from the hasOne array on the Vendor model,
everything renders, but there's no association between the two. I'm
new to Cake and I think I'm thinking about this incorrectly, but I
don't know what I'm missing.
Any insight would be appreciated.
Rob
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---