Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

belongs_to doesn't work with $auto_prefix_models #70

Closed
girtsu opened this issue Aug 6, 2013 · 0 comments
Closed

belongs_to doesn't work with $auto_prefix_models #70

girtsu opened this issue Aug 6, 2013 · 0 comments
Assignees
Milestone

Comments

@girtsu
Copy link

girtsu commented Aug 6, 2013

$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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants