diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-21 21:34:14 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-21 21:34:14 +0200 |
| commit | ec8329069d36cc6aa444c8a48b6b34a3e8f5c9d2 (patch) | |
| tree | 8a94a94984c0ff20cb3e6dcf12ee212fc98a9ae0 /app/views/nodes | |
| parent | 5b951f012e04e6ef97e4ef645d53bdf433a9eb7f (diff) | |
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.
Diffstat (limited to 'app/views/nodes')
| -rw-r--r-- | app/views/nodes/show.html.erb | 2 |
1 files changed, 1 insertions, 1 deletions
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 @@ | |||
| 254 | </div> | 254 | </div> |
| 255 | 255 | ||
| 256 | <% if @page.assets.images.any? %> | 256 | <% if @page.assets.images.any? %> |
| 257 | <% headline_asset_id = @page.related_assets.find_by(headline: true)&.asset_id %> | 257 | <% headline_asset_id = @page.headline_asset&.id %> |
| 258 | <div class="node_description">Images</div> | 258 | <div class="node_description">Images</div> |
| 259 | <div class="node_content node_info_group"> | 259 | <div class="node_content node_info_group"> |
| 260 | <ul class="thumbnail_list"> | 260 | <ul class="thumbnail_list"> |
