diff --git a/Gemfile b/Gemfile index d508a2f..af12801 100644 --- a/Gemfile +++ b/Gemfile @@ -1,2 +1 @@ -#gem 'acts-as-taggable-on', '~> 4.0' -gem 'acts-as-taggable-on', '5.0.0' +gem 'acts-as-taggable-on', '~> 6.0' diff --git a/init.rb b/init.rb index d9d3de7..d7130b6 100644 --- a/init.rb +++ b/init.rb @@ -92,14 +92,31 @@ end end + # redmine4 -ActiveSupport::Reloader.to_prepare do -#ActionDispatch::Callbacks.to_prepare do - require 'tagging_plugin/tagging_patches' - require 'tagging_plugin/api_template_handler_patch' - require 'redmine_tagging' - require File.expand_path('../app/helpers/tagging_helper', __FILE__) - ActionView::Base.send :include, TaggingHelper -end +# ActiveSupport::Reloader.to_prepare do +# #ActionDispatch::Callbacks.to_prepare do +# require 'tagging_plugin/tagging_patches' +# require 'tagging_plugin/api_template_handler_patch' +# require 'redmine_tagging' +# require File.expand_path('../app/helpers/tagging_helper', __FILE__) +# ActionView::Base.send :include, TaggingHelper +if Rails::VERSION::MAJOR == 5 + ActiveSupport::Reloader.to_prepare do + require 'tagging_plugin/tagging_patches' + require 'tagging_plugin/api_template_handler_patch' + require 'redmine_tagging' + require File.expand_path('../app/helpers/tagging_helper', __FILE__) + ActionView::Base.send :include, TaggingHelper + end +else + ActionDispatch::Callbacks.to_prepare do + require 'tagging_plugin/tagging_patches' + require 'tagging_plugin/api_template_handler_patch' + require 'redmine_tagging' + require File.expand_path('../app/helpers/tagging_helper', __FILE__) + ActionView::Base.send :include, TaggingHelper + end +end require_dependency 'tagging_plugin/tagging_hooks' diff --git a/lib/redmine_tagging/patches/issue_patch.rb b/lib/redmine_tagging/patches/issue_patch.rb index 21421ea..70b8e93 100644 --- a/lib/redmine_tagging/patches/issue_patch.rb +++ b/lib/redmine_tagging/patches/issue_patch.rb @@ -15,10 +15,10 @@ module RedmineTagging::Patches::IssuePatch has_many :issue_tags - #alias_method_chain :create_journal, :tags + # alias_method_chain :create_journal, :tags alias_method :create_journal_without_tags, :create_journal alias_method :create_journal, :create_journal_with_tags - + # alias_method_chain :init_journal, :tags alias_method :init_journal_without_tags, :init_journal alias_method :init_journal, :init_journal_with_tags diff --git a/lib/tagging_plugin/tagging_patches.rb b/lib/tagging_plugin/tagging_patches.rb index 2230bef..ed4547f 100755 --- a/lib/tagging_plugin/tagging_patches.rb +++ b/lib/tagging_plugin/tagging_patches.rb @@ -27,7 +27,7 @@ def self.included(base) # :nodoc: base.class_eval do unloadable - #alias_method_chain :update, :tags + # alias_method_chain :update, :tags alias_method :update_without_tags, :update alias_method :update, :update_with_tags end