From ec8329069d36cc6aa444c8a48b6b34a3e8f5c9d2 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Tue, 21 Jul 2026 21:34:14 +0200 Subject: Extract Page#headline_asset The same related_assets.find_by(headline: true) query was written by hand in three places -- content_helper, nodes#show, and the chapter teaser partial (which was still using assets.first, the old position-based rule, until now). Collapsed to one method, one query. --- app/views/nodes/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/nodes/show.html.erb') diff --git a/app/views/nodes/show.html.erb b/app/views/nodes/show.html.erb index a7be3c6f..f2b4b154 100644 --- a/app/views/nodes/show.html.erb +++ b/app/views/nodes/show.html.erb @@ -254,7 +254,7 @@ <% if @page.assets.images.any? %> - <% headline_asset_id = @page.related_assets.find_by(headline: true)&.asset_id %> + <% headline_asset_id = @page.headline_asset&.id %>
Images