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

Regression in polymorphic associations in ActiveRecord 5.2 #902

Closed
rzane opened this issue Apr 13, 2018 · 5 comments
Closed

Regression in polymorphic associations in ActiveRecord 5.2 #902

rzane opened this issue Apr 13, 2018 · 5 comments

Comments

@rzane
Copy link
Contributor

rzane commented Apr 13, 2018

This issue only affects Active Record 5.2.

In Active Record < 5.2, polymorphic joins will include a condition on the _type column.

LEFT OUTER JOIN "people"
ON "people"."id" = "notes"."notable_id" AND "notes"."notable_type" = 'Person'

In Active Record 5.2, the condition will not be included:

LEFT OUTER JOIN "people"
ON "people"."id" = "notes"."notable_id"

I created an issue on the polyamorous repo, but I figured more users are likely to see the issue here.

Sorry for the noise, here's the original issue: activerecord-hackery/polyamorous#37

@scarroll32
Copy link
Member

No problem re: noise. Is it possible to create some failing tests on a branch?

@rzane
Copy link
Contributor Author

rzane commented Nov 5, 2018

Sure, I'll see if I can come up with a reproduction case through the Ransack API. I use polyamorous for baby_squeel, and that's where I noticed the issue. Though, I'm pretty sure I was able to reproduce using ransack.

@dholdren
Copy link

I ran into this issue as well. I'm using ransack 2.1.1 which now includes the polyamorous code

@gregmolnar
Copy link
Member

@rzane Can you verify that this PR fixes your issue? #1004

@scarroll32
Copy link
Member

Closed due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants