Skip to content

Empty selecting doesn't combine with other selecting #80

Description

@octavpo

For any model I try, a query like:

Package.selecting{}.selecting{name}.first

or

Package.selecting{nil}.selecting{name}.first

fails with an error:

Arel::Visitors::UnsupportedVisitError: Unsupported argument type: NilClass. Construct an Arel node instead.

This happens when the tests in the first selecting are conditioned by an expression that happens to be false. I don't see how I can construct an Arel node in this case. Each of the two selecting works fine by itself. Similar expressions work fine with other constructs like where.has and joining, and select also works fine in squeel. So I'm hoping it's just a bug. Thanks.

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