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

Informix visitor ignores joins #105

Closed
jhollinger opened this issue Feb 29, 2012 · 1 comment
Closed

Informix visitor ignores joins #105

jhollinger opened this issue Feb 29, 2012 · 1 comment

Comments

@jhollinger
Copy link

Using Arel 3.0.2 with Rails 3.2, but I believe the bug has always been present. A joined query like Comment.joins("inner join posts on post.id = comments.post_id").where("posts.published = 1") results in the invalid sql statement select * from comments where posts.published = 1.

It's a one-line patch to visit_Arel_Nodes_SelectCore in lib/arel/visitors/informix.rb:

- ("FROM #{visit o.froms}" if o.froms),
+ ("FROM #{visit o.source}" if o.source),

I plan to fork and submit a pull request soon, unless someone can point out a problem with that solution.

@tenderlove
Copy link
Member

Looks good. I'll close this and wait for a pull request from you. Please make sure to include a test so that I don't break it in the future! Thank you.

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

No branches or pull requests

2 participants