Skip to content

Commit d9f245c

Browse files
committed
Merge branch 'feature/redmine4' of github.com:mamewotoko/redmine_tagging into feature/redmine4
2 parents 8a64350 + b5ac7d9 commit d9f245c

File tree

4 files changed

+29
-13
lines changed

4 files changed

+29
-13
lines changed

Gemfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
#gem 'acts-as-taggable-on', '~> 4.0'
2-
gem 'acts-as-taggable-on', '5.0.0'
1+
gem 'acts-as-taggable-on', '~> 6.0'

init.rb

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,31 @@
9292
end
9393
end
9494

95+
9596
# redmine4
96-
ActiveSupport::Reloader.to_prepare do
97-
#ActionDispatch::Callbacks.to_prepare do
98-
require 'tagging_plugin/tagging_patches'
99-
require 'tagging_plugin/api_template_handler_patch'
100-
require 'redmine_tagging'
101-
require File.expand_path('../app/helpers/tagging_helper', __FILE__)
102-
ActionView::Base.send :include, TaggingHelper
103-
end
97+
# ActiveSupport::Reloader.to_prepare do
98+
# #ActionDispatch::Callbacks.to_prepare do
99+
# require 'tagging_plugin/tagging_patches'
100+
# require 'tagging_plugin/api_template_handler_patch'
101+
# require 'redmine_tagging'
102+
# require File.expand_path('../app/helpers/tagging_helper', __FILE__)
103+
# ActionView::Base.send :include, TaggingHelper
104104

105+
if Rails::VERSION::MAJOR == 5
106+
ActiveSupport::Reloader.to_prepare do
107+
require 'tagging_plugin/tagging_patches'
108+
require 'tagging_plugin/api_template_handler_patch'
109+
require 'redmine_tagging'
110+
require File.expand_path('../app/helpers/tagging_helper', __FILE__)
111+
ActionView::Base.send :include, TaggingHelper
112+
end
113+
else
114+
ActionDispatch::Callbacks.to_prepare do
115+
require 'tagging_plugin/tagging_patches'
116+
require 'tagging_plugin/api_template_handler_patch'
117+
require 'redmine_tagging'
118+
require File.expand_path('../app/helpers/tagging_helper', __FILE__)
119+
ActionView::Base.send :include, TaggingHelper
120+
end
121+
end
105122
require_dependency 'tagging_plugin/tagging_hooks'

lib/redmine_tagging/patches/issue_patch.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ module RedmineTagging::Patches::IssuePatch
1515

1616
has_many :issue_tags
1717

18-
#alias_method_chain :create_journal, :tags
18+
# alias_method_chain :create_journal, :tags
1919
alias_method :create_journal_without_tags, :create_journal
2020
alias_method :create_journal, :create_journal_with_tags
21-
21+
2222
# alias_method_chain :init_journal, :tags
2323
alias_method :init_journal_without_tags, :init_journal
2424
alias_method :init_journal, :init_journal_with_tags

lib/tagging_plugin/tagging_patches.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def self.included(base) # :nodoc:
2727
base.class_eval do
2828
unloadable
2929

30-
#alias_method_chain :update, :tags
30+
# alias_method_chain :update, :tags
3131
alias_method :update_without_tags, :update
3232
alias_method :update, :update_with_tags
3333
end

0 commit comments

Comments
 (0)