Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ This will move the selected category to the bottom of the list for that project

# Revision History

## 1.0.1
* Updated to work with Redmine 4.2.3.stable
* Fix compatibility with other plugins

## 1.0.0
* Add support for Rails >= 5

Expand Down
2 changes: 1 addition & 1 deletion db/migrate/001_issue_category_acts_as_nested_set.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class IssueCategoryActsAsNestedSet < ActiveRecord::Migration
class IssueCategoryActsAsNestedSet < ActiveRecord::Migration[4.2]

def self.up
add_column :issue_categories, :parent_id, :integer, :null => true
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/002_fix_defaut_value_for_lft_and_rgt_columns.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class FixDefautValueForLftAndRgtColumns < ActiveRecord::Migration
class FixDefautValueForLftAndRgtColumns < ActiveRecord::Migration[4.2]
def self.up
change_column :issue_categories, :lft, :integer, :null => false, :default => '0'
change_column :issue_categories, :rgt, :integer, :null => false, :default => '0'
Expand Down
4 changes: 2 additions & 2 deletions init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
require 'redmine_category_tree/hooks/redmine_category_tree_hooks'
require File.dirname(__FILE__) + '/app/views/helpers/redmine_category_tree/issue_category_helper.rb'

Rails.configuration.to_prepare do
#((Rails.version > "5")? ActiveSupport::Reloader : ActionDispatch::Callbacks).to_prepare do
#Rails.configuration.to_prepare do
((Rails.version > "5")? ActiveSupport::Reloader : ActionDispatch::Callbacks).to_prepare do

## Helpers first
require_dependency 'application_helper'
Expand Down
19 changes: 16 additions & 3 deletions lib/redmine_category_tree/patches/application_helper_patch.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
module RedmineCategoryTree
module Patches
module ApplicationHelperPatch
def format_object(object, html=true, &block)
def self.included(base)
base.send(:include, InstanceMethods)

base.class_eval do
unloadable

alias_method :format_object_without_category_tree, :format_object
alias_method :format_object, :format_object_with_category_tree

end
end

def format_object_with_category_tree(object, html=true, &block)
if block_given?
object = yield object
end
case object.class.name
when 'IssueCategory'
render_issue_category_with_tree_inline(object)
else
super
# super
format_object_without_category_tree(object, html, &block)
end
end
end
end
end
end
4 changes: 2 additions & 2 deletions lib/redmine_category_tree/patches/issue_query_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ def self.prepended(base)
end
end

def initialize_available_filters
def initialize_available_filters_category_tree
super
add_available_filter "category_id",
:type => :list_optional,
:values => lambda { issue_category_tree_options_to_json(project.issue_categories) } if project
end
end
end
end
end
2 changes: 1 addition & 1 deletion lib/redmine_category_tree/patches/queries_helper_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Patches
module QueriesHelperPatch
include RedmineCategoryTree::IssueCategoryHelper

def column_content(column, issue)
def column_content_category_tree(column, issue)
if column.name == :category
render_issue_category_with_tree(issue.category)
else
Expand Down