From 6a8e67038e9b1a3fd260931b823739f8a7247bd0 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Fri, 22 Aug 2025 13:02:08 -0400 Subject: [PATCH] Mark `Form::AdminSettings#persisted?` as true --- 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 5f23e683b99..f938d57aa53 100644 --- a/app/models/form/admin_settings.rb +++ b/app/models/form/admin_settings.rb @@ -142,6 +142,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 1eb47a0b54e..42c19644ba0 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 62e9c724592..d2c1ce70ddb 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 51d482d70a5..d35d39089c3 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 cb5a3eb6baf..58d939e8286 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