From e7d5d0b2c32b172ecdaa80555bf5804043fd87a0 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sat, 27 Jun 2026 00:32:17 +0200 Subject: Fix I18n::InvalidLocale :root errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix Page.find(self.head) → self.head in node.rb wipe_draft! - Migration to delete 407 spurious 'root' locale records from page_translations (Globalize artefact, all had nil titles and duplicate de/en translations existed for all affected pages) --- ...20260626222953_remove_root_locale_from_page_translations.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 db/migrate/20260626222953_remove_root_locale_from_page_translations.rb (limited to 'db') diff --git a/db/migrate/20260626222953_remove_root_locale_from_page_translations.rb b/db/migrate/20260626222953_remove_root_locale_from_page_translations.rb new file mode 100644 index 0000000..51fcfbc --- /dev/null +++ b/db/migrate/20260626222953_remove_root_locale_from_page_translations.rb @@ -0,0 +1,10 @@ +class RemoveRootLocaleFromPageTranslations < ActiveRecord::Migration[7.2] + def up + count = execute("DELETE FROM page_translations WHERE locale = 'root'").cmd_tuples + say "Deleted #{count} root locale records from page_translations" + end + + def down + raise ActiveRecord::IrreversibleMigration + end +end -- cgit v1.3