title: Rails: How to filter and sort products?
body: <p><code>Product</code> has the following attributes:</p>
  
  <ul>
  <li>shop</li>
  <li>model</li>
  <li>price</li>
  </ul>
  
  <p><code>Model</code> belongs to:</p>
  
  <ul>
  <li>brand</li>
  </ul>
  
  <p>Given <code>@products</code>, like:</p>
  
  <pre><code>Shop    Brand    Model    Price
  ----    -----    -----    -----
  Ebay    Sony     S-100    500
  Ebay    Sony     S-200    1000        (in Target it's cheaper)
  Ebay    Dell     D-55     300
  Target  Sony     S-100    600         (in Ebay it's cheaper)
  Target  Sony     S-200    900
  Amazon  Dell     D-33     100
  </code></pre>
  
  <p>I would like to filter only those with the lowest price, i.e. I expect to get:</p>
  
  <pre><code>Shop    Brand    Model    Price
  ----    -----    -----    -----
  Ebay    Sony     S-100    500
  Ebay    Dell     D-55     300
  Target  Sony     S-200    900
  Amazon  Dell     D-33     100
  </code></pre>
  
  <p>and preferably to sort by <code>Brand</code> and then by <code>Model</code>:</p>
  
  <pre><code>Shop    Brand    Model    Price
  ----    -----    -----    -----
  Ebay    Sony     S-100    500
  Target  Sony     S-200    900
  Amazon  Dell     D-33     100
  Ebay    Dell     D-55     300
  </code></pre>
  
  <p>How could I do this ?</p>