diff --git a/README.md b/README.md index a458587..e1b0433 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ This plugin enables github style emoji notation in textile formatter and adds a Compatibility ------------- -The latest version supports Redmine **2.6.x** as well as **3.x** +The latest version supports Redmine **2.6.x** as well as **3.x** and **4.x** diff --git a/lib/emojibutton_helper_patch.rb b/lib/emojibutton_helper_patch.rb index 8050324..dc64e91 100644 --- a/lib/emojibutton_helper_patch.rb +++ b/lib/emojibutton_helper_patch.rb @@ -22,7 +22,12 @@ def self.included(base) # :nodoc: base.send(:include, HelperMethodsWikiExtensions) base.class_eval do unloadable # Send unloadable so it will not be unloaded in development - alias_method_chain :heads_for_wiki_formatter, :redmine_emojibutton + if Rails.version < '5.0.0' + alias_method_chain :heads_for_wiki_formatter, :redmine_emojibutton + else + alias_method :heads_for_wiki_formatter_without_redmine_emojibutton, :heads_for_wiki_formatter + alias_method :heads_for_wiki_formatter, :heads_for_wiki_formatter_with_redmine_emojibutton + end end end end