title: Rails 4 Selecting uniq objects related AR CollectionProxy
body: <p>I'm dealing with a shopping cart, which has many products in it. The products can be sold by multiple different companies. What I'm trying to do is select the companies uniquely so that I can create one order per vendor.</p>
  
  <p><em>the hack</em></p>
  
  <pre><code>companies = []
  @cart.products.each { |p| companies &lt;&lt; p.company }
  companies.uniq
  #create order for each company
  </code></pre>
  
  <p>I'm not sure if <code>#pluck</code> is something I should be using here, but I do know that there has got to be a more efficient way of collecting my companies "uniquely". <code>#uniq</code> doesn't seem to be working for me, and neither does <code>@cart.products.pluck(:company)</code></p>
  
  <p><strong>I have no <code>:company_id</code> in my Bid model, it's a <code>has_many/has_one</code> relationship</strong></p>