Skip to content

Commit a3d9d45

Browse files
committed
Fixing a reference to $association_name instead of $this->name for has_many foreign_keys
1 parent 48b30ac commit a3d9d45

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/models/mvc_model.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ protected function init_associations() {
625625
'type' => 'has_many',
626626
'name' => empty($value['name']) ? $association_name : $value['name'],
627627
'class' => empty($value['class']) ? $association_name : $value['class'],
628-
'foreign_key' => empty($value['foreign_key']) ? MvcInflector::underscore($association_name).'_id' : $value['foreign_key'],
628+
'foreign_key' => empty($value['foreign_key']) ? MvcInflector::underscore($this->name).'_id' : $value['foreign_key'],
629629
'fields' => isset($value['fields']) ? $value['fields'] : null,
630630
'includes' => null
631631
);

0 commit comments

Comments
 (0)