From a292162c5f4ae835ccbbbd161f8f6b597ae75df1 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 17 Dec 2025 03:32:24 -0500 Subject: [PATCH] Mark `Form::AdminSettings#persisted?` as true (#35872) --- app/models/form/admin_settings.rb | 4 ++++ app/views/admin/settings/about/show.html.haml | 2 +- app/views/admin/settings/appearance/show.html.haml | 2 +- app/views/admin/settings/branding/show.html.haml | 2 +- app/views/admin/settings/content_retention/show.html.haml | 2 +- app/views/admin/settings/discovery/show.html.haml | 2 +- app/views/admin/settings/registrations/show.html.haml | 2 +- spec/models/form/admin_settings_spec.rb | 4 ++++ 8 files changed, 14 insertions(+), 6 deletions(-) diff --git a/app/models/form/admin_settings.rb b/app/models/form/admin_settings.rb index af4ad38ae94..142b0b45603 100644 --- a/app/models/form/admin_settings.rb +++ b/app/models/form/admin_settings.rb @@ -154,6 +154,10 @@ class Form::AdminSettings end end + def persisted? + true + end + private def cache_digest_value(key) diff --git a/app/views/admin/settings/about/show.html.haml b/app/views/admin/settings/about/show.html.haml index adc8f1ff04a..c4df98e7041 100644 --- a/app/views/admin/settings/about/show.html.haml +++ b/app/views/admin/settings/about/show.html.haml @@ -5,7 +5,7 @@ %h2= t('admin.settings.title') = render partial: 'admin/settings/shared/links' -= simple_form_for @admin_settings, url: admin_settings_about_path, html: { method: :patch } do |f| += simple_form_for @admin_settings, url: admin_settings_about_path do |f| = render 'shared/error_messages', object: @admin_settings %p.lead= t('admin.settings.about.preamble') diff --git a/app/views/admin/settings/appearance/show.html.haml b/app/views/admin/settings/appearance/show.html.haml index c610f9f9417..20208df1524 100644 --- a/app/views/admin/settings/appearance/show.html.haml +++ b/app/views/admin/settings/appearance/show.html.haml @@ -5,7 +5,7 @@ %h2= t('admin.settings.title') = render partial: 'admin/settings/shared/links' -= simple_form_for @admin_settings, url: admin_settings_appearance_path, html: { method: :patch } do |f| += simple_form_for @admin_settings, url: admin_settings_appearance_path do |f| = render 'shared/error_messages', object: @admin_settings %p.lead= t('admin.settings.appearance.preamble') diff --git a/app/views/admin/settings/branding/show.html.haml b/app/views/admin/settings/branding/show.html.haml index 05795a19745..22116167eb3 100644 --- a/app/views/admin/settings/branding/show.html.haml +++ b/app/views/admin/settings/branding/show.html.haml @@ -5,7 +5,7 @@ %h2= t('admin.settings.title') = render partial: 'admin/settings/shared/links' -= simple_form_for @admin_settings, url: admin_settings_branding_path, html: { method: :patch } do |f| += simple_form_for @admin_settings, url: admin_settings_branding_path do |f| = render 'shared/error_messages', object: @admin_settings %p.lead= t('admin.settings.branding.preamble') diff --git a/app/views/admin/settings/content_retention/show.html.haml b/app/views/admin/settings/content_retention/show.html.haml index 57485c1108f..c6c39fdf444 100644 --- a/app/views/admin/settings/content_retention/show.html.haml +++ b/app/views/admin/settings/content_retention/show.html.haml @@ -5,7 +5,7 @@ %h2= t('admin.settings.title') = render partial: 'admin/settings/shared/links' -= simple_form_for @admin_settings, url: admin_settings_content_retention_path, html: { method: :patch } do |f| += simple_form_for @admin_settings, url: admin_settings_content_retention_path do |f| = render 'shared/error_messages', object: @admin_settings %p.lead= t('admin.settings.content_retention.preamble') diff --git a/app/views/admin/settings/discovery/show.html.haml b/app/views/admin/settings/discovery/show.html.haml index 04c242597d3..5b9aab3fedc 100644 --- a/app/views/admin/settings/discovery/show.html.haml +++ b/app/views/admin/settings/discovery/show.html.haml @@ -5,7 +5,7 @@ %h2= t('admin.settings.title') = render partial: 'admin/settings/shared/links' -= simple_form_for @admin_settings, url: admin_settings_discovery_path, html: { method: :patch } do |f| += simple_form_for @admin_settings, url: admin_settings_discovery_path do |f| = render 'shared/error_messages', object: @admin_settings %p.lead= t('admin.settings.discovery.preamble') diff --git a/app/views/admin/settings/registrations/show.html.haml b/app/views/admin/settings/registrations/show.html.haml index 7303eca662a..92f755e9e58 100644 --- a/app/views/admin/settings/registrations/show.html.haml +++ b/app/views/admin/settings/registrations/show.html.haml @@ -5,7 +5,7 @@ %h2= t('admin.settings.title') = render partial: 'admin/settings/shared/links' -= simple_form_for @admin_settings, url: admin_settings_registrations_path, html: { method: :patch } do |f| += simple_form_for @admin_settings, url: admin_settings_registrations_path do |f| = render 'shared/error_messages', object: @admin_settings %p.lead= t('admin.settings.registrations.preamble') diff --git a/spec/models/form/admin_settings_spec.rb b/spec/models/form/admin_settings_spec.rb index 899d56703a9..e734734e000 100644 --- a/spec/models/form/admin_settings_spec.rb +++ b/spec/models/form/admin_settings_spec.rb @@ -53,4 +53,8 @@ RSpec.describe Form::AdminSettings do end end end + + describe '#persisted?' do + it { is_expected.to be_persisted } + end end