diff --git a/init.rb b/init.rb index ea48ae2..ea2c4c7 100644 --- a/init.rb +++ b/init.rb @@ -2,7 +2,7 @@ name 'Code Highlight plugin' author 'Jan Jezek' description 'This is a plugin for Redmine. It adds a CodeHighlight Button to the editor, which wraps a code around selected text' - version '0.3.0' + version '0.4.0' url 'https://github.com/mediatainment/redmine-codebutton' author_url 'http://www.mediatainment-productions.com' diff --git a/lib/wiki_codehighlight_helper_patch.rb b/lib/wiki_codehighlight_helper_patch.rb index 41f8e68..e19f48c 100644 --- a/lib/wiki_codehighlight_helper_patch.rb +++ b/lib/wiki_codehighlight_helper_patch.rb @@ -23,7 +23,12 @@ def self.included(base) # :nodoc: base.class_eval do unloadable # Send unloadable so it will not be unloaded in development - alias_method_chain :heads_for_wiki_formatter, :redmine_codebutton + if Rails.version < '5.0.0' + alias_method_chain :heads_for_wiki_formatter, :redmine_codebutton + else + alias_method :heads_for_wiki_formatter_without_redmine_codebutton, :heads_for_wiki_formatter + alias_method :heads_for_wiki_formatter, :heads_for_wiki_formatter_with_redmine_codebutton + end end end