mirror of
https://github.com/redmine/redmine.git
synced 2025-12-16 05:20:28 +01:00
Add support for "start with" and "end with" operators to "Files" filter (#31879).
Patch by Yuichi HARADA. git-svn-id: http://svn.redmine.org/redmine/trunk@18570 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -526,6 +526,9 @@ class IssueQuery < Query
|
||||
c = sql_contains("a.filename", value.first)
|
||||
e = (operator == "~" ? "EXISTS" : "NOT EXISTS")
|
||||
"#{e} (SELECT 1 FROM #{Attachment.table_name} a WHERE a.container_type = 'Issue' AND a.container_id = #{Issue.table_name}.id AND #{c})"
|
||||
when "^", "$"
|
||||
c = sql_contains("a.filename", value.first, (operator == "^" ? :starts_with : :ends_with) => true)
|
||||
"EXISTS (SELECT 1 FROM #{Attachment.table_name} a WHERE a.container_type = 'Issue' AND a.container_id = #{Issue.table_name}.id AND #{c})"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user