2
0

Fix recent settings migrations (#36602)

This commit is contained in:
Claire
2025-10-27 13:24:24 +01:00
committed by GitHub
parent ab5b7e3776
commit 38f15a89fe
3 changed files with 21 additions and 5 deletions

View File

@@ -12,8 +12,7 @@ class MigrateTimelinePreviewSetting < ActiveRecord::Migration[8.0]
Setting.upsert_all(
%w(local_live_feed_access remote_live_feed_access local_topic_feed_access remote_topic_feed_access).map do |var|
{ var: var, value: value ? "--- public\n" : "--- authenticated\n" }
end,
unique_by: :var
end
)
end

View File

@@ -9,10 +9,10 @@ class MigrateLandingPageSetting < ActiveRecord::Migration[8.0]
value = YAML.safe_load(setting.attributes['value'], permitted_classes: [ActiveSupport::HashWithIndifferentAccess, Symbol])
Setting.upsert(
Setting.upsert({
var: 'landing_page',
value: value ? "--- trends\n" : "--- about\n"
)
value: value ? "--- trends\n" : "--- about\n",
})
end
def down; end