-
Notifications
You must be signed in to change notification settings - Fork 10
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
Composite foreign keys #32
Comments
+1 |
Thanks for the detailed report! When I get a chance I'll create a test case and PR a fix :) |
Fixed in #31 |
How is it fixed if the exception causing code is this referenced fix? Was this closed by mistake?
|
Yes I closed it by mistake. My apologies! I was going through older issues and thought this was fixed by the other PK fix. |
I took a look and can't create a test case around your scenario. I'm not sure how really. Can you give me 2 simple table examples where you end up with a BelongsTo that has a composite key that is stored on the parent table? |
The issue
This trait is currently missing support for foreign keys that consist out of multiple columns.
The cause
The suspected line of code is at line 133:
The code fails to check the return type of the
getForeignKey()
call, which is defined asstring|string[]
. If the foreign key is defined as an array of columns, the trait will fail with:What happens here is that you try to access an array index of type array, which can't work.
The solution
The text was updated successfully, but these errors were encountered: