diff options
Diffstat (limited to 'app/models/issue_query.rb')
-rw-r--r-- | app/models/issue_query.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/issue_query.rb b/app/models/issue_query.rb index 7701cbfe2..155462c64 100644 --- a/app/models/issue_query.rb +++ b/app/models/issue_query.rb @@ -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 |