Merge commit '4dc21d7afdb485402555908bc72d071f8b25ec36' into glitch-soc/merge-upstream

Conflicts:
- `config/settings.yml`:
  Upstream replaced a setting with 4 new ones, while glitch-soc had modified
  the default value of that setting.
  Removed the old setting and added the new settings, but with defaults
  matching glitch-soc's previous behavior.
This commit is contained in:
Claire
2025-10-06 19:12:25 +02:00
105 changed files with 692 additions and 423 deletions

View File

@@ -0,0 +1,21 @@
# frozen_string_literal: true
class MigrateTimelinePreviewSetting < ActiveRecord::Migration[8.0]
class Setting < ApplicationRecord; end
def up
setting = Setting.find_by(var: 'timeline_preview')
return unless setting.present? && setting.attributes['value'].present?
value = YAML.safe_load(setting.attributes['value'], permitted_classes: [ActiveSupport::HashWithIndifferentAccess, Symbol])
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
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_09_24_170259) do
ActiveRecord::Schema[8.0].define(version: 2025_10_02_140103) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_catalog.plpgsql"