title: Can this raw SQL be written using the Rails Active Record Query Interface? Should it be?
body: <p>In my Rails 4 app I make a fairly simple search for one of my models using the following SQL 'OR' statements. It works fine. Is there any way (and reason) to achieve this without raw SQL using the Rails Active Record Query Interface? </p>
  
  <pre><code>Activity.where("
      user_id = ? OR 
      category = ? OR 
      (secondary_id = ? AND secondary_model = ?) OR 
      (tertiary_id = ? AND tertiary_model = ?)",
      user_id, "Announcement", user_id, "user", user_id, "user"
  ).uniq
  </code></pre>