Skip to content

Commit

Permalink
use ProjectsController.send
Browse files Browse the repository at this point in the history
  • Loading branch information
haru committed Sep 4, 2021
1 parent 747b685 commit c9ccde0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion init.rb
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
7 changes: 5 additions & 2 deletions lib/wiki_extensions_projects_helper_patch.rb
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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',
Expand All @@ -32,4 +35,4 @@ def project_settings_tabs
end
end

ProjectsHelper.prepend(ProjectsHelperMethodsWikiExtensions)

0 comments on commit c9ccde0

Please sign in to comment.