mirror of
https://github.com/System-End/cdn.git
synced 2026-04-19 15:18:15 +00:00
ouh?
This commit is contained in:
parent
ae1ffadfcd
commit
6e2a751587
1 changed files with 4 additions and 1 deletions
|
|
@ -18,7 +18,10 @@ module Admin
|
|||
end
|
||||
|
||||
def search_uploads(query)
|
||||
Upload.search(query).includes(:blob, :user).order(created_at: :desc).limit(50)
|
||||
by_search = Upload.search(query)
|
||||
by_url = Upload.where("original_url ILIKE ?", "%#{Upload.sanitize_sql_like(query)}%")
|
||||
Upload.where(id: by_search.select(:id)).or(Upload.where(id: by_url.select(:id)))
|
||||
.includes(:blob, :user).order(created_at: :desc).limit(50)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue