summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-21 22:28:18 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-21 22:28:18 +0200
commit9c951f3a0f379b0f459988106cf3f839acdadbe2 (patch)
treead51cb1700689bfa0915a1319576412d68f66150 /app/controllers
parent987c8224c7f1bafb84d5e284ff0093921b92f1a0 (diff)
More PDF headline eligibility
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/related_assets_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/related_assets_controller.rb b/app/controllers/related_assets_controller.rb
index 2fefaf7..560df75 100644
--- a/app/controllers/related_assets_controller.rb
+++ b/app/controllers/related_assets_controller.rb
@@ -5,10 +5,10 @@ class RelatedAssetsController < ApplicationController
5 def search 5 def search
6 term = params[:search_term].to_s.strip 6 term = params[:search_term].to_s.strip
7 attached_ids = @node.editable_page.related_assets.pluck(:asset_id) 7 attached_ids = @node.editable_page.related_assets.pluck(:asset_id)
8 scope = Asset.images.where.not(id: attached_ids) 8 scope = Asset.headline_eligible.where.not(id: attached_ids)
9 9
10 results = if term.present? 10 results = if term.present?
11 scope.where("name ILIKE ?", "%#{term}%").limit(10) 11 scope.where("name ILIKE :term OR upload_file_name ILIKE :term", term: "%#{term}%").limit(10)
12 else 12 else
13 scope.order(created_at: :desc).limit(5) 13 scope.order(created_at: :desc).limit(5)
14 end 14 end