rails/arel — Issue #105: Informix visitor ignores joins
Author: jhollinger
Created: 2012-02-29 18:41:12+00:00
State: open

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.