Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7575915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:47:44+00:00 2026-05-30T16:47:44+00:00

I am working on a project which used this plugin . I really can’t

  • 0

I am working on a project which used this plugin. I really can’t use any other plugin to do what I have to do.

I am using this to build a WHERE clause in my query, which is otherwise built. Here’s how I am doing it:

cond = EZ::Where::Condition.new
if first_condition
  cond.append "A > B"
end
if second_condition
  cond.append "C < D"
end
if third_condition
  cond.or "E > F"
  cond.or "G > H"
end

The issue is that any combitions of the first, second or third conditions can be true. But in every case, my query is supposed to be like this:

Where A > B AND C < D AND (E > F OR G > H)

And if Only first and third condition is true then:

Where A > B AND (E > F OR G > H)

How do I do it in ez_where plugin for ruby on rails? Or if not that, how do I do that at all?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T16:47:45+00:00Added an answer on May 30, 2026 at 4:47 pm
    cond = EZ::Where::Condition.new
    if first_condition
      cond.append "A > B"
    end
    if second_condition
      cond.append "C < D"
    end
    if third_condition
      cond.or "E > F"
      cond.or "G > H"
    end
    

    I just realized a really easy way of doing the above would be

    cond1 = EZ::Where::Condition.new
    if first_condition
      cond1.append "A > B"
    end
    if second_condition
      cond1.append "C < D"
    end
    cond2 = EZ::Where::Condition.new
    if third_condition
      cond2.or "E > F"
      cond2.or "G > H"
    end
    cond = EZ::Where::Condition.new
    cond.append cond
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a project which I'm really not sure how to unit test.
I am working on a project which will be using large datasets (both 2D
I have been working on one project which is too complex and contain very
I am working on a project using the uploadify jquery plugin and CastleProject Monorail
I have used the signalR chat app (as laid out in this tutorial http://sergiotapia.com/2011/09/signalr-with-mvc3-chat-app-build-asynchronous-real-time-persistant-connection-websites/
I'm working on a project which is being used by a number of people
I have been working on a project which is about data copy from one
I'm working on a project which uses OpenGL framebuffer/renderbuffer to draw freehand lines. This
I'm working on a project in which we're actively using the $Id$ string generated
I have this login code, which works last night before I slept. Nobody used

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.