Skip to content

Commit

Permalink
Merge branch 'feature/redmine4' of github.com:mamewotoko/redmine_tagg…
Browse files Browse the repository at this point in the history
…ing into feature/redmine4
  • Loading branch information
mamewotoko committed Jan 27, 2020
2 parents 8a64350 + b5ac7d9 commit d9f245c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 13 deletions.
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -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'
33 changes: 25 additions & 8 deletions init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
4 changes: 2 additions & 2 deletions lib/redmine_tagging/patches/issue_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/tagging_plugin/tagging_patches.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d9f245c

Please sign in to comment.