Skip to content

Arel::Visitors::Informix ignores joins #9

Description

@jhollinger

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions