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. --- test/models/page_test.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test/models') diff --git a/test/models/page_test.rb b/test/models/page_test.rb index 1f924f9..98a00d2 100644 --- a/test/models/page_test.rb +++ b/test/models/page_test.rb @@ -309,11 +309,15 @@ class PageTest < ActiveSupport::TestCase kept_asset = Asset.create!(:upload_file_name => "kept.png", :upload_content_type => "image/png", :upload_file_size => 1) removed_asset = Asset.create!(:upload_file_name => "removed.pdf", :upload_content_type => "application/pdf", :upload_file_size => 1) - n.head.update_assets([kept_asset.id, removed_asset.id]) + n.head.related_assets.delete_all + n.head.related_assets.create!(:asset_id => kept_asset.id, :position => 1) + n.head.related_assets.create!(:asset_id => removed_asset.id, :position => 2) d2 = find_or_create_draft(n, @user1) added_asset = Asset.create!(:upload_file_name => "added.png", :upload_content_type => "image/png", :upload_file_size => 1) - d2.update_assets([kept_asset.id, added_asset.id]) + d2.related_assets.delete_all + d2.related_assets.create!(:asset_id => kept_asset.id, :position => 1) + d2.related_assets.create!(:asset_id => added_asset.id, :position => 2) d2.save! diff = d2.diff_against(n.head) -- cgit v1.3