summaryrefslogtreecommitdiff
path: root/script12.rb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-11 00:53:53 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-11 00:53:53 +0200
commit876697bdff7e03d98a7a426895b4e5dcc07c5a88 (patch)
treec467325da4bef60f8831324f2bd8dcec59aecfc3 /script12.rb
parentab392d472c15eee3618cb7c02b2b4707151598b6 (diff)
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.
Diffstat (limited to 'script12.rb')
-rw-r--r--script12.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/script12.rb b/script12.rb
new file mode 100644
index 0000000..659557c
--- /dev/null
+++ b/script12.rb
@@ -0,0 +1,23 @@
1require 'timeout'
2
3a = Node.root.children.create!(:slug => "cycle_test_a")
4b = a.children.create!(:slug => "cycle_test_b")
5
6a.staged_parent_id = b.id
7a.publish_draft!
8a.reload
9
10puts "a.parent_id after staging a under its own child b: #{a.parent_id.inspect} (b.id = #{b.id})"
11puts "Node.valid? => #{Node.valid?}"
12
13begin
14 Timeout.timeout(3) { puts "a.level => #{a.level}" }
15rescue Timeout::Error
16 puts "TIMED OUT after 3s -- a real cycle and a real infinite loop, confirmed"
17end
18
19# Break any cycle before cleanup -- delete_descendants does its own BFS
20# the same way #level does, and would hang on a real cycle too.
21Node.where(id: a.id).update_all(parent_id: nil)
22b.destroy
23a.destroy