From cc4659a308590be083065f19df8571efc345052a Mon Sep 17 00:00:00 2001 From: erdgeist Date: Tue, 21 Jul 2026 15:39:56 +0200 Subject: Remove Page#update_assets Only caller left was the sort_images action removed last commit. Kept alive only as a test-setup convenience for diff_against coverage, which is what it actually was -- an implicit API with no deliberate contract, sitting there for anyone to call. Rewrote the one test to set up its fixture state directly via related_assets rather than through a method whose real job was already done. --- app/models/page.rb | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'app/models') diff --git a/app/models/page.rb b/app/models/page.rb index ab42b1c..c1498fc 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -319,22 +319,6 @@ class Page < ApplicationRecord end end - def update_assets image_ids - transaction do - previous_headline_asset_id = self.related_assets.find_by(headline: true)&.asset_id - - self.related_assets.delete_all - - if image_ids - image_ids.each_with_index do |id, index| - asset = Asset.find(id) - self.related_assets.create!(:asset_id => asset.id, :position => index+1, - :headline => asset.id == previous_headline_asset_id) - end - end - end - end - # Installs (or re-installs) the trigger that keeps page_translations' # search_vector in sync. Idempotent, safe to call on every boot. # search_vector is populated by a raw Postgres trigger, not anything -- cgit v1.3