We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 48b30ac commit a3d9d45Copy full SHA for a3d9d45
core/models/mvc_model.php
@@ -625,7 +625,7 @@ protected function init_associations() {
625
'type' => 'has_many',
626
'name' => empty($value['name']) ? $association_name : $value['name'],
627
'class' => empty($value['class']) ? $association_name : $value['class'],
628
- 'foreign_key' => empty($value['foreign_key']) ? MvcInflector::underscore($association_name).'_id' : $value['foreign_key'],
+ 'foreign_key' => empty($value['foreign_key']) ? MvcInflector::underscore($this->name).'_id' : $value['foreign_key'],
629
'fields' => isset($value['fields']) ? $value['fields'] : null,
630
'includes' => null
631
);
0 commit comments