Skip to content

How can I use OR with a GROUP of ANDS? #129

Open
@timfong888

Description

@timfong888

I want to do the equivalent of (Ay) OR (Cy). how can i do that?

Right now, I am creating separate queries:

@companies_with_email = Company.contact_emails_date_sent_gt(@monday).
                               contact_emails_date_sent_lt(@friday).
                               find(:all, :select => "distinct companies.*")  || [] 

@companies_with_calls = Company.contact_calls_date_sent_gt(@monday).
                               contact_calls_date_sent_lt(@friday).
                               find(:all, :select => "distinct companies.*")  || []  

And then I @companies_with_calls + @companeis_with_emails

But this will continue to create problems since I don't want duplicates.

I'd like to be able to do it within searchlogic, is this possible?

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