Actions
Defect #26863
closedfile: issue_query.rb function:sql_for_issue_id_field line: ids = value.first.to_s.scan(/\d+/).map(&:to_i) should the first to be deleted?
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Invalid
Affected version:
Description
I'm writing a redmine plugin using: IssueQuery
where when I want to use :
myquery.add_filter("issue_id" , "=", ["123", "124","125"])
I got only the first issue.
finally i find the function:sql_for_issue_id_field
def sql_for_issue_id_field(field, operator, value)
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
sql_for_field("id", operator, value, Issue.table_name, "id")
end
end
I seems that the "first" is a error?
BTW: i'm new to ruby and redmine.
Actions