Skip to content
This repository has been archived by the owner on Apr 16, 2023. It is now read-only.

where-or breaks preloading of associations with conditions #2

Closed
myabc opened this issue Oct 12, 2015 · 5 comments · Fixed by #4
Closed

where-or breaks preloading of associations with conditions #2

myabc opened this issue Oct 12, 2015 · 5 comments · Fixed by #4

Comments

@myabc
Copy link

myabc 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
Copy link

oyeanuj commented Nov 25, 2015

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

@davidgeere
Copy link

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

@bf4
Copy link
Collaborator

bf4 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
Copy link
Contributor

robmathews 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
Copy link
Contributor

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants