title: Update models based on association record value
body: <p>I have thousands of price comparators where each of them have many products. The comparator has an attribute <code>:minimum_price</code> which is the minimum price of it's products. What would be the fastest way to update all comparators <code>:minimum_price</code></p>
  <p><strong>Comparator.rb</strong></p>
  <pre class="lang-rb prettyprint-override"><code>has_many :products
  </code></pre>
  <p><strong>Product.rb</strong></p>
  <pre class="lang-rb prettyprint-override"><code>belongs_to :comparator
  </code></pre>
  <p>Let's imagine the following:</p>
  <pre><code>comparator_1 have 3 products with a price of 3, 5, 7
  comparator_2 have 2 products with a price of 2, 4
  </code></pre>
  <p>How could I update all comparators <code>:minimum_price</code> in one query ?</p>