summaryrefslogtreecommitdiffstats
path: root/app/models/issue_query.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/issue_query.rb')
-rw-r--r--app/models/issue_query.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/issue_query.rb b/app/models/issue_query.rb
index c97de0a19..c4ab37d59 100644
--- a/app/models/issue_query.rb
+++ b/app/models/issue_query.rb
@@ -245,6 +245,8 @@ class IssueQuery < Query
add_available_filter "parent_id", :type => :tree, :label => :field_parent_issue
add_available_filter "child_id", :type => :tree, :label => :label_subtask_plural
+ add_available_filter "issue_id", :type => :integer, :label => :label_issue
+
Tracker.disabled_core_fields(trackers).each {|field|
delete_available_filter field
}
@@ -509,6 +511,15 @@ class IssueQuery < Query
end
end
+ def sql_for_issue_id_field(field, operator, value)
+ ids = value.first.to_s.scan(/\d+/).map(&:to_i).join(",")
+ if ids.present?
+ "#{Issue.table_name}.id IN (#{ids})"
+ else
+ "1=0"
+ end
+ end
+
def sql_for_relations(field, operator, value, options={})
relation_options = IssueRelation::TYPES[field]
return relation_options unless relation_options