summaryrefslogtreecommitdiffstats
path: root/app/models/issue_query.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-08-30 19:28:00 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-08-30 19:28:00 +0000
commit9f9232381ab6fc11a1d8a06bdbfb33d54d4e3623 (patch)
treeb08c9c2ffc55ee33be3447c6b56693f43b75d43b /app/models/issue_query.rb
parentd5ca4a3593de4f997c3caa10ed3cd74f95307571 (diff)
downloadredmine-9f9232381ab6fc11a1d8a06bdbfb33d54d4e3623.tar.gz
redmine-9f9232381ab6fc11a1d8a06bdbfb33d54d4e3623.zip
Filter on issue ID with between/lesser/greater operator does not work (#23596).
git-svn-id: http://svn.redmine.org/redmine/trunk@15751 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue_query.rb')
-rw-r--r--app/models/issue_query.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/app/models/issue_query.rb b/app/models/issue_query.rb
index 0846d7096..c3923940c 100644
--- a/app/models/issue_query.rb
+++ b/app/models/issue_query.rb
@@ -466,11 +466,16 @@ class IssueQuery < Query
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})"
+ if operator == "="
+ # accepts a comma separated list of ids
+ ids = value.first.to_s.scan(/\d+/).map(&:to_i)
+ if ids.present?
+ "#{Issue.table_name}.id IN (#{ids.join(",")})"
+ else
+ "1=0"
+ end
else
- "1=0"
+ sql_for_field("id", operator, value, Issue.table_name, "id")
end
end