codeigniter-base-model
codeigniter-base-model copied to clipboard
missing primary key in has many relation
when set $has_many variable and execute get_all method i got an error in line 493
public $has_many = array("family_member" => array("model" => "Form_family_model"));
So please edit documentation to this
public $has_many = array( 'comments' => array( 'model' => 'model_comments', 'primary_key' => 'post_id' ) );
Or add this code after line 484
$options["primary_key"] = $this->primary_key;
Thanks for this – could you send in a pull request making the change yourself? I'll happily merge it.
On 24 June 2014 14:34, Saleh Saiid [email protected] wrote:
when set $has_many variable and execute get_all method i got an error in line 493
public $has_many = array("family_member" => array("model" => "Form_family_model"));
So please edit documentation to this
public $has_many = array( 'comments' => array( 'model' => 'model_comments', 'primary_key' => 'post_id' ) );
Or add this code after line 484
$options["primary_key"] = $this->primary_key;
— Reply to this email directly or view it on GitHub https://github.com/jamierumbelow/codeigniter-base-model/issues/174.
Jamie Rumbelow [email protected]
Please pull this request. It would have saved me 30 minutes. :)
@rscotten It's already opened #175 @jamierumbelow