title: Rails: Use destroy action in model's method
body: <p>I need to do some task before I destroy a user. I am doing a system for a network marketing company. I need to change the user of users. So this is what I did: </p>
  
  <pre><code>class User &lt; ActiveRecord::Base
  
  
      def delete_this_user
        some_actions
  .
  .
  .
        self.destroy
  end
  
  
  end
  </code></pre>
  
  <p>the </p>
  
  <p><code>self.destroy</code> doesn't destroy the user from the database. Can anybody help? Thanks </p>