module RedmineEventOutbox
  module Patches
    module JournalPatch
      def self.included(base)
        base.class_eval do
          after_commit :record_event_outbox_journal_created, :on => :create
        end
      end

      private

      def record_event_outbox_journal_created
        RedmineEventOutbox::Event.record_journal_created(self, User.current)
      end
    end
  end
end
