title: How can I order multiple ActiveRecords in rails by time?
body: <p>In my controller, I needed to add logical operators like || and &amp;&amp; in my but it's not working so I thought it would be easier for me to make different variables with each one its own condition and then order them as if they're one using created_at DESC.</p>
  
  <pre><code>@postActivity = PublicActivity::Activity.order("created_at DESC").where( owner_id: current_user.following.ids, key: 'posting' ).limit(20).all
  @commentActivity = PublicActivity::Activity.order("created_at DESC").where( key: 'commenting' ).limit(20).all
  </code></pre>
  
  <p>The conditions are much more complicated than those above.
  If you could point out a different way then sure do, appreciated.
  PS. I'm a ruby newbie .. </p>