a guest Jun 26th, 2019 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. query = Model.find_something
  2. query = query.where(condition1: true) if condition1 == true
  3. query = query.where(condition2: true) if condition2 == true
  4. query = query.where(condition3: true) if condition3 == true
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand