module Door::Loggable
  extend ActiveSupport::Concern

  included do
    has_one :log_entry, as: :loggable
    before_create :associate_log_entry
    #after_create :spam_irc
  end

  def public_message
  end

  private

  def associate_log_entry
    self.log_entry = build_log_entry
  end

  def spam_irc
    message = public_message
    if message.present?
      begin
        IrcBotNotifierJob.perform_now message
      rescue Exception
      end
    end
    true
  end
end

module Door::Loggable
  extend ActiveSupport::Concern

  included do
    has_one :log_entry, as: :loggable
    before_create :associate_log_entry
    after_create :spam_irc
  end

  def public_message
  end

  private

  def associate_log_entry
    self.log_entry = build_log_entry
  end

  def spam_irc
    message = public_message
    if message.present?
      begin
        IrcBotNotifierJob.perform_now message
      rescue Exception
      end
    end
    true
  end
end

Revert "Remove IRC logging of door events"
Revert "Remove IRC logging of door events"

This reverts commit d80d873fb65b6a187f3cafa2c5617f60c135a77e.
