Add a new setting to choose the server landing page (#36588)

This commit is contained in:
Renaud Chaput
2025-10-27 11:16:59 +01:00
committed by GitHub
parent e40ca321ed
commit 779a1f8448
72 changed files with 81 additions and 135 deletions

View File

@@ -0,0 +1,19 @@
# frozen_string_literal: true
class MigrateLandingPageSetting < ActiveRecord::Migration[8.0]
class Setting < ApplicationRecord; end
def up
setting = Setting.find_by(var: 'trends_as_landing_page')
return unless setting.present? && setting.attributes['value'].present?
value = YAML.safe_load(setting.attributes['value'], permitted_classes: [ActiveSupport::HashWithIndifferentAccess, Symbol])
Setting.upsert(
var: 'landing_page',
value: value ? "--- trends\n" : "--- about\n"
)
end
def down; end
end

View File

@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[8.0].define(version: 2025_10_07_142305) do
ActiveRecord::Schema[8.0].define(version: 2025_10_23_210145) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_catalog.plpgsql"