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:
@@ -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
|
||||
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user