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

where-or breaks preloading of associations with conditions #2

Closed
myabc opened this issue Oct 12, 2015 · 5 comments

Comments

Projects
None yet
5 participants
@myabc
Copy link

commented Oct 12, 2015

TypeError: Cannot visit ActiveRecord::Relation::WhereClause

See https://github.com/myabc/where-or-example and https://gist.github.com/bf4/84cff9cc6ac8489d769e#gistcomment-1593871 for a reproduction.

@oyeanuj

This comment has been minimized.

Copy link

commented Nov 25, 2015

I am seeing the same issue. @myabc did you find a solution to this?

@MitchellGeere

This comment has been minimized.

Copy link

commented Jun 19, 2016

Exactly the same issue here, @myabc did you ever figure this one out?

@bf4

This comment has been minimized.

Copy link
Collaborator

commented Jun 19, 2016

I just saw this. I'm still using my patch in Rails 4.2.6 and am busy debugging other things right now ;) but how about take a look and see if any of the source files I've listed have changed in Rails 5 since I made the patch. If not, it might be a bug in Rails 5 :)

@robmathews

This comment has been minimized.

Copy link
Contributor

commented Jun 20, 2016

I just upgraded @myabc example to rails5 and tested it. Works fine, so I'd guess that remerging the files down would work. Here's my url - https://github.com/robmathews/where-or-example. So one of us should definitely look at the source files that have changed in the original commit, it would probably be short strokes to make the PR.

@robmathews

This comment has been minimized.

Copy link
Contributor

commented Jun 24, 2016

Seems that the where.or! patch failed to take into account that the preloader needs to merge the AST trees.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.