From 876697bdff7e03d98a7a426895b4e5dcc07c5a88 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sat, 11 Jul 2026 00:53:53 +0200 Subject: Style admin pagination widget, add missing locale keys Pagination had almost no styling, and its current-page selector never matched will_paginate's actual markup. Added chip-style page links, a solid current-page indicator, and distinct disabled states for Previous/Next. Previous/Next/gap rendered as empty, unlabeled elements -- will_paginate only ships English translations and this app defaults to German. Added previous_label/next_label/page_gap to en.yml and de.yml. --- script12.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 script12.rb (limited to 'script12.rb') diff --git a/script12.rb b/script12.rb new file mode 100644 index 0000000..659557c --- /dev/null +++ b/script12.rb @@ -0,0 +1,23 @@ +require 'timeout' + +a = Node.root.children.create!(:slug => "cycle_test_a") +b = a.children.create!(:slug => "cycle_test_b") + +a.staged_parent_id = b.id +a.publish_draft! +a.reload + +puts "a.parent_id after staging a under its own child b: #{a.parent_id.inspect} (b.id = #{b.id})" +puts "Node.valid? => #{Node.valid?}" + +begin + Timeout.timeout(3) { puts "a.level => #{a.level}" } +rescue Timeout::Error + puts "TIMED OUT after 3s -- a real cycle and a real infinite loop, confirmed" +end + +# Break any cycle before cleanup -- delete_descendants does its own BFS +# the same way #level does, and would hang on a real cycle too. +Node.where(id: a.id).update_all(parent_id: nil) +b.destroy +a.destroy -- cgit v1.3