title: Is destroying a persistent record in a `before_validation` callback bad code?
body: <p>I want to prevent reports where the values of <code>distributed</code> &amp;&amp; <code>checked</code> are both nil || zero from being created.</p>
  
  <p>I also want users to be able to delete existing reports by setting these values to either nil or zero in the form (reports are created and edited in batches and the UX leans towards setting the value to 0 or deleting the values from the form instead of a 'delete' button).</p>
  
  <p>As a hobbyist, something about this feels like a bad idea:</p>
  
  <pre><code>class Report &lt; ApplicationRecord
    ...
    before_validation :prevent_meaningless_reports, if: (distributed.nil? || distributed.zero?) &amp;&amp; (checked.nil? || checked.zero?)
    ...
  
    ...
  
    private
  
    def prevent_meaningless_reports
      if new_record?
        throw :abort
      else #persisted?
        self.destroy
      end
    end
  end
  </code></pre>
  
  <p>It feels bad to be destroying a record during a <code>before_*</code> callback.</p>
  
  <p>I'm risking asking a potentially opinion-based question because it seems like I might be violating some software principle that would tell me why this is a bad idea.</p>
  
  <p>If this is acceptable behavior, is it better to do this in two blocks, one for <code>before_create</code> (for new records) and one for <code>before_update</code> (for persistent records)?</p>