Skip to content

belongs_to doesn't work with $auto_prefix_models #70

@girtsu

Description

@girtsu

$auto_prefix_models is used only in Model::factory. When I use has_many, Paris tries to use class name without namespace prefix to determine the table name for the joined entity.

It can be fixed by changing the first line of the has_many method from

$associated_table_name = self::_get_table_name($associated_class_name);

to

$associated_table_name = self::_get_table_name(self::$auto_prefix_models . $associated_class_name);

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions