From c9ccde03651a6b23696051a8cbb7d9f25b2df22a Mon Sep 17 00:00:00 2001 From: Haruyuki Iida Date: Sat, 4 Sep 2021 16:54:44 +0900 Subject: [PATCH] use ProjectsController.send --- init.rb | 6 +++++- lib/wiki_extensions_projects_helper_patch.rb | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/init.rb b/init.rb index 9cd163f..9a0891a 100644 --- a/init.rb +++ b/init.rb @@ -1,5 +1,5 @@ # Wiki Extensions plugin for Redmine -# Copyright (C) 2009-2020 Haruyuki Iida +# Copyright (C) 2009-2021 Haruyuki Iida # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -21,6 +21,10 @@ end require 'redmine/wiki_formatting/textile/redcloth3' +Rails.configuration.to_prepare do + ProjectsHelperMethodsWikiExtensions.apply +end + require_dependency 'wiki_extensions_notifiable_patch' Dir::foreach(File.join(File.dirname(__FILE__), 'lib')) do |file| next unless /\.rb$/ =~ file diff --git a/lib/wiki_extensions_projects_helper_patch.rb b/lib/wiki_extensions_projects_helper_patch.rb index 2fc4857..efd8372 100644 --- a/lib/wiki_extensions_projects_helper_patch.rb +++ b/lib/wiki_extensions_projects_helper_patch.rb @@ -1,5 +1,5 @@ # Wiki Extensions plugin for Redmine -# Copyright (C) 2009-2017 Haruyuki Iida +# Copyright (C) 2009-2021 Haruyuki Iida # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -18,6 +18,9 @@ require_dependency 'projects_helper' module ProjectsHelperMethodsWikiExtensions + def self.apply + ProjectsController.send :helper, ProjectsHelperMethodsWikiExtensions + end def project_settings_tabs tabs = super action = {:name => 'wiki_extensions', @@ -32,4 +35,4 @@ def project_settings_tabs end end -ProjectsHelper.prepend(ProjectsHelperMethodsWikiExtensions) +