-
-
Notifications
You must be signed in to change notification settings - Fork 910
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
v4.5.0 breaks Composite Primary Keys #1392
Comments
Thank you for all the details. I'll take a look at that as soon as possible. |
@vsppedro I think I see the problem. With v4.4.1, if we were providing a With v4.5.0 it runs The In my case Array(foreign_key).all? { |f| column_names_for(klass).include?(f) } This is weird for everyone who doesn't use Composite Primary Keys, since I'm unsure what |
@natematykiewicz, nice! We need to add tests to prevent something like this from happening again.
I think we only need to adapt the error message when it fails because more than one foreing_key is missing or incorrect.
I agree and to be honest, I'm not sure if the support for this gem was added before, I couldn't find any tests for it or even any reference in the Changelog. But as it was working and I ended up removing this feature I intend to add some tests and return the behavior. Thank you very much for your help! |
I think we can close this. Thanks again for your contribution! |
Sounds good to me. No problem! |
We use composite primary keys. I believe this PR has caused an incompatibility #1376.
Spec
Model
With v4.4.1 this spec would succeed.
With v4.5.0 it fails with:
As a test of v4.4.1 I tried removing the foreign key from the model, and also changing one of the values of the array:
Ex:
Both of these fail with:
This is the error message that #1376 aimed to fix. This also shows me that the foreign key check was indeed working (I was worried I had a false positive before).
Looking at the diff, I'm not sure why this isn't working anymore.
The text was updated successfully, but these errors were encountered: