Permalink
Browse files

Fixed #7

  • Loading branch information...
1 parent 7435d19 commit e806c3cbf0b67f574c6a86f603ad8750000c1110 @onozaty committed Jun 20, 2015
Showing with 29 additions and 27 deletions.
  1. +2 −2 init.rb
  2. +27 −25 lib/redmine_parent_issue_filter.rb
View
@@ -1,10 +1,10 @@
-require_dependency 'query_patch'
+require_dependency 'redmine_parent_issue_filter'
Redmine::Plugin.register :parent_issue_filter do
name 'Parent issue filter plugin'
author 'onozaty'
description 'Parent issue filter plugin for Redmine'
- version '1.0.1'
+ version '1.0.2'
url 'https://github.com/onozaty/redmine-parent-issue-filter'
author_url 'https://github.com/onozaty'
end
@@ -1,36 +1,38 @@
-module QueryPatch
- def self.included(base) # :nodoc:
- base.send(:include, InstanceMethods)
+module RedmineParentIssueFilter
+ module QueryPatch
+ def self.included(base) # :nodoc:
+ base.send(:include, InstanceMethods)
- # Same as typing in the class
- base.class_eval do
- unloadable # Send unloadable so it will not be unloaded in development
+ # Same as typing in the class
+ base.class_eval do
+ unloadable # Send unloadable so it will not be unloaded in development
- alias_method_chain :available_filters, :parent_id
+ alias_method_chain :available_filters, :parent_id
+ end
end
- end
- module InstanceMethods
+ module InstanceMethods
- # Wrapper around the +available_filters+ to add a new Deliverable filter
- def available_filters_with_parent_id
- @available_filters = available_filters_without_parent_id
+ # Wrapper around the +available_filters+ to add a new Deliverable filter
+ def available_filters_with_parent_id
+ @available_filters = available_filters_without_parent_id
- parent_id_filters = {
- "parent_id" => {
- :name => l(:field_parent_issue),
- :type => :integer,
- :order => @available_filters.size + 1},
- "root_id" => {
- :name => l(:field_root_issue),
- :type => :integer,
- :order => @available_filters.size + 2}
- }
+ parent_id_filters = {
+ "parent_id" => {
+ :name => l(:field_parent_issue),
+ :type => :integer,
+ :order => @available_filters.size + 1},
+ "root_id" => {
+ :name => l(:field_root_issue),
+ :type => :integer,
+ :order => @available_filters.size + 2}
+ }
- return @available_filters.merge!(parent_id_filters)
+ return @available_filters.merge!(parent_id_filters)
+ end
end
- end
+ end
end
# Add module to Query
-Query.send(:include, QueryPatch)
+Query.send(:include, RedmineParentIssueFilter::QueryPatch)

0 comments on commit e806c3c

Please sign in to comment.