mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
Fix backend code for searching by a filetype as a combination of uploads and topic links. Add rspec test for extracting file extension in upload.
This commit is contained in:
parent
f0a674d620
commit
8c445e9f17
4 changed files with 11 additions and 6 deletions
|
@ -462,7 +462,11 @@ class Search
|
|||
posts.where("posts.id IN (
|
||||
SELECT post_id FROM topic_links
|
||||
WHERE extension IN (?)
|
||||
)", file_extensions)
|
||||
UNION
|
||||
SELECT post_uploads.post_id FROM uploads
|
||||
JOIN post_uploads ON post_uploads.upload_id = uploads.id
|
||||
WHERE lower(uploads.extension) IN (?)
|
||||
)", file_extensions, file_extensions)
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue