key_field not working on custom has_many
Hospital_model
protected $key_field = 'hospital_id';
Doctors_model
public $has_many = array(
'hospitals' => array('hospitals_model'),
);
error
Unknown column 'slmc_hospitals.id' in 'where clause'
SELECT `slmc_hospitals`.* FROM `slmc_hospitals` WHERE `slmc_hospitals`.`id` IN(2) AND `slmc_hospitals`.`published` = 'yes'
What is wrong in my code, thank you.
Comments