title: Rails 4 after_commit nested conditions issue
body: <p>I would like to trigger the same function for <code>after_commit</code> on both <code>update</code> and <code>create</code> BUT I would like to apply a particular condition <em>only</em> for <code>update</code>. </p>
  
  <p>For now, my only solution was to duplicate the function and make two different <code>after_commit</code> like this:</p>
  
  <pre><code>after_commit :my_method_on_update,
                 on: :update,
                 if: -&gt;(foo) { foo.previous_changes.key?(:bar) }
  
  after_commit :my_method_on_destroy, on: :destroy
  
  def my_method_on_update
    # stuff
  end
  
  def my_method_on_destroy
    # same stuff here
  end
  </code></pre>
  
  <p>Of course it works but it doesn't make the code DRY at all. I'm sure there is a better solution but I haven't found any relevant examples on the official rails <a href="http://api.rubyonrails.org/classes/ActiveRecord/Transactions/ClassMethods.html#method-i-after_commit" rel="nofollow noreferrer">doc</a></p>
  
  <p>What I'd like is something like this:</p>
  
  <pre><code>after_commit :my_method,
                 on: :update,
                 if: -&gt;(foo) { foo.previous_changes.key?(:bar) },
                 on: destroy
  
  def my_method
    # stuff
  end
  </code></pre>
  
  <p>But there is an error with twice the declaration of <code>on</code>.</p>