title: Rails - AciveRecord use :dependent => :destroy on condition
body: <p><strong>What will be the best/DRY way to destroy all the dependents of an object based on a condition. ?</strong></p>
  
  <p>Ex:</p>
  
  <pre><code>class Worker &lt; ActiveRecord::Base
   has_many :jobs , :dependent =&gt; :destroy
   has_many :coworkers , :dependent =&gt; :destroy
   has_many :company_credit_cards, :dependent =&gt; :destroy
  end 
  </code></pre>
  
  <p>condition will be
  <strong>on Destroy:</strong></p>
  
  <pre><code>if self.is_fired? 
   #Destroy dependants records
  else
   # Do not Destroy records
  end 
  </code></pre>
  
  <p>Is There a Way to use Proc in the :dependent condition.
  I have found the methods to destroy the dependents individually, but this is not DRY and flexible for further associations, </p>
  
  <p>Note: I have made up the example.. not an actual logic</p>