Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
timfong888 opened this issue Oct 5, 2010 · 1 comment
Open

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

timfong888 opened this issue Oct 5, 2010 · 1 comment

Comments

@timfong888
Copy link

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?

@graywh
Copy link

graywh commented Jul 6, 2012

I'm using searchlogic in an old rails 2.3 app (using ransack with all 3.x apps; really need to upgrade this one) and just ran into a case that could use this functionality.

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

No branches or pull requests

2 participants