title: Rails where or clause within controller
body: <p>I am trying to specify the index view in my controller with a where or clause. Right now, the code is only returning the condition before the ||, if it finds that. </p>
  
  <p>My code:</p>
  
  <pre><code>  def index
      @trades = Trade.where(grower_id: session[:user_id]) || 
      Trade.where(consumer_id: session[:user_id])
    end
  </code></pre>
  
  <p>I've tried:</p>
  
  <pre><code>@trades = Trade.where(grower_id: session[:user_id]).or(Trade.where(consumer_id: session[:user_id]))
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>@trades = Trade.where(grower_id: session[:user_id])  ||=(Trade.where(consumer_id: session[:user_id]))
  </code></pre>
  
  <p>I also checked out <a href="https://stackoverflow.com/questions/18860959/rails-activerecord-where-or-clause">this response</a>, but those suggestions aren't working. </p>
  
  <p>Any help would be greatly appreciated!</p>