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

Arel::Visitors::Informix ignores joins #9

Open
jhollinger opened this issue Jan 24, 2012 · 1 comment
Open

Arel::Visitors::Informix ignores joins #9

jhollinger opened this issue Jan 24, 2012 · 1 comment

Comments

@jhollinger
Copy link

I am using Arel v3.0 with Informix in ActiveRecord in Rails 3.2. 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 seems visit_Arel_Nodes_SelectCore in the Informix Visitor class is ignoring the joins. I was able to fix it with the following changes in lib/arel/visitors/informix.rb:

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

Don't know if that's a "good" fix or not. If no one comments on this soon, I'll probably fork and submit a pull request.

(This problem was present in earlier versions of both Arel and Rails, but I don't how far back it goes.)

@nicb
Copy link

nicb commented Apr 6, 2013

This solved my problem too! Thanks. Has there been any development to this since you posted this issue? I have checked your forked arel code and it does not seem to carry the mod you made for this issue.

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

No branches or pull requests

2 participants