title: Rails Observer, How to determine what Triggered the after_destroy
body: <p>I have a observer setup as follows:</p>
  
  <pre><code>class FeedObserver &lt; ActiveRecord::Observer
    observe :permission
    def after_destroy(record)
  
      Rails.logger.info 'XXXXXXXXXXXXXXXXXXXXXXXXX    Feed Observer - after_destroy      XXXXXXXXXXXXXXXXXXXXXXXXXXX'
      Rails.logger.info record.inspect
      Rails.logger.info record.class.name
      Rails.logger.info record.class
      Rails.logger.info 'XXXXXXXXXXXXXXXXXXXXXXXXX    Feed Observer - after_destroy      XXXXXXXXXXXXXXXXXXXXXXXXXXX'
  
    end
  
  end
  </code></pre>
  
  <p>In the logs this ends up looking a little like:</p>
  
  <pre><code>XXXXXXXXXXXXXXXXXXXXXXXXX    Feed Observer - after_destroy      XXXXXXXXXXXXXXXXXXXXXXXXXXX
  #&lt;Permission id: 52, project_id: 12, role_id: 2, user_id: 1&gt;
  Permission
  Permission
  XXXXXXXXXXXXXXXXXXXXXXXXX    Feed Observer - after_destroy      XXXXXXXXXXXXXXXXXXXXXXXXXXX
  </code></pre>
  
  <p>The problem with this is that in my permissions controller there are two methods that can delete a permission object, destory and leaveproject..</p>
  
  <p>In the observer, how can I determine what method was called that resulted in the Feed observer being called?</p>
  
  <p>Thanks</p>