title: Running validations when using `update_all`
body: <p>According to the Rails docs <a href="http://guides.rubyonrails.org/active_record_validations.html#skipping-validations" rel="noreferrer">here</a> and <a href="http://apidock.com/rails/ActiveRecord/Relation/update_all" rel="noreferrer">here</a>, using <code>update_all</code> does not do the following -</p>
  
  <ul>
  <li>It skips validations</li>
  <li>It does not update the <code>updated_at</code> field</li>
  <li>It silently ignores the <code>:limit</code> and <code>:order</code> methods</li>
  </ul>
  
  <p>I'm trying to go through my code base and remove instances of <code>update_all</code>, particularly because of the first point.</p>
  
  <p>Is there a way to still have the convenience of <code>update_all</code> and still run validations? I understand that I can loop through each record and save it, but that's not only messier visually but also more more inefficient because it executes N SQL statements instead of 1</p>
  
  <pre><code># before
  User.where(status: "active").update_all(status: "inactive")
  # after
  User.where(status: "active").each { |u| u.update(status: "inactive") }
  </code></pre>
  
  <p>Thanks!</p>
  
  <p><strong>Edit:</strong> I'm using Rails 4.2</p>