module Pwfmt::SettingPatch
  extend ActiveSupport::Concern

  included do
    after_save :persist_wiki_format
  end

  def persist_wiki_format
    PwfmtFormat.persist(self, 'settings_welcome_text')
  end
end

require 'setting'
Setting.__send__(:include, Pwfmt::SettingPatch)

module Pwfmt::SettingPatch
  extend ActiveSupport::Concern

  included do
    after_save :persist_wiki_format
  end

  def persist_wiki_format
    PwfmtFormat.persist(self, 'settings_welcome_text')
  end
end

Rails.configuration.to_prepare do
  require 'setting'
  Setting.__send__(:include, Pwfmt::SettingPatch)
end

Fix breaking Setting object after loading this plugin.
Fix breaking Setting object after loading this plugin.

Without this patch, this plugin requires 'setting' at plugin loading,
and after that, next loaded plugin cannot access to
Setting.plugin_#{@plugin.id} method (NoMethodError).

This seems to be related to the thread below:
  http://www.redmine.org/boards/3/topics/16587
