title: Know what event triggered the after_commit of an ActiveRecord model
body: <p>I have the following snippet:</p>
  
  <pre><code>class Product
   after_commit :do_something, on: %i(update create)
  
   def do_something
     if # update
       ...
     else # create
       ...
     end
   end
  end
  </code></pre>
  
  <p><strong>How to know what event triggered the after commit here?</strong></p>
  
  <p>Please don't tell me to have 2 after commits like:</p>
  
  <pre><code>after_commit :do_something_on_update, on: :update
  after_commit :do_something_on_create, on: :create
  </code></pre>