Fixed #105 - Join table name not generated properly#109
Fixed #105 - Join table name not generated properly#109n-at-han-k wants to merge 2 commits intoj4mie:masterfrom n-at-han-k:master
Conversation
passed it a model to associate with that had a namespace.
e.g. $post->has_many_through('\\Blog\\Models\\Tag');
The error was that it wasn't correctly creating the table
name for the join.
e.g. post_tag was instead post_blog_models_tag
Thus results weren't being fetched.
|
The Travis CI build fails for 5.2 due to the unit test using namespaces. |
|
Thanks for the pull request. To get your tests to pass you need to change
|
This is because the test is meant to test features of PHP 5.3+ so obviously the cases will fail.
|
Sorted it. Tests now pass. |
|
I have run into this same problem - is there any chance this can be merged into master? |
|
There is a chance. I've just got to get around to it. Unfortunately I've
started another job and various other life stuff is still consuming my
time. It's certainly on my to do list.
|
|
Merged into |
There was an issue with the has_many_through method. When you
passed it a model to associate with that had a namespace.
e.g. $post->has_many_through('\Blog\Models\Tag');
The error was that it wasn't correctly creating the table
name for the join.
e.g. post_tag was instead post_blog_models_tag
Thus results weren't being fetched.
Basically it was performing an algorithm to extract the class name from the namespace on one of the classes but not the other. So Paris would end up requesting a table like "post_namespace_namespace_tag" instead of "post_tag".
Fixes #105