summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-08-31 16:55:53 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-08-31 16:55:53 +0000
commit62f9b56c1e6973f204ed289f96136db6a74b8b5b (patch)
tree5a211b1297202e1723849e397a6cca856e5d04d5 /app
parentea40ce8ba93ba5525594c0ef1edcad9482223e92 (diff)
downloadredmine-62f9b56c1e6973f204ed289f96136db6a74b8b5b.tar.gz
redmine-62f9b56c1e6973f204ed289f96136db6a74b8b5b.zip
Merged r15751 (#23596).
git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@15770 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-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 c4ab37d59..01302cfb0 100644
--- a/app/models/issue_query.rb
+++ b/app/models/issue_query.rb
@@ -512,11 +512,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