Stop rails from swallowing after_commit exceptions

Problem
By default rails just swallows any exception raised in after_commit blocks.

Solution
Send these exceptions to and exception service to get notified (Airbrake / Rollbar etc).

Gem
https://github.com/grosser/after_commit_exception_notification

Copy-paste

module Foo
  module CommittedWithExceptions
    def committed!
      super
    rescue Exception => e # same as active_record/connection_adapters/abstract/database_statements.rb:370
      ExceptionService.report("after_commit exception", e)
      raise
    end
  end
end

ActiveRecord::Base.include Foo::CommittedWithExceptions