From bd64ca2583615579670b1d4bea8c9f49bd726f74 Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 18 Feb 2026 14:18:44 +0100 Subject: [PATCH] Add new profile settings (#37890) --- app/models/account.rb | 3 +++ app/serializers/rest/account_serializer.rb | 3 ++- .../20260217154542_add_profile_settings_to_accounts.rb | 9 +++++++++ db/schema.rb | 5 ++++- 4 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20260217154542_add_profile_settings_to_accounts.rb diff --git a/app/models/account.rb b/app/models/account.rb index 7623e2398c..a1bafc8fd6 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -46,6 +46,9 @@ # reviewed_at :datetime # sensitized_at :datetime # shared_inbox_url :string default(""), not null +# show_featured :boolean default(TRUE), not null +# show_media :boolean default(TRUE), not null +# show_media_replies :boolean default(TRUE), not null # silenced_at :datetime # suspended_at :datetime # suspension_origin :integer diff --git a/app/serializers/rest/account_serializer.rb b/app/serializers/rest/account_serializer.rb index 3fa541f445..e97baa8612 100644 --- a/app/serializers/rest/account_serializer.rb +++ b/app/serializers/rest/account_serializer.rb @@ -8,7 +8,8 @@ class REST::AccountSerializer < ActiveModel::Serializer attributes :id, :username, :acct, :display_name, :locked, :bot, :discoverable, :indexable, :group, :created_at, :note, :url, :uri, :avatar, :avatar_static, :avatar_description, :header, :header_static, :header_description, - :followers_count, :following_count, :statuses_count, :last_status_at, :hide_collections + :followers_count, :following_count, :statuses_count, :last_status_at, :hide_collections, + :show_media, :show_media_replies, :show_featured has_one :moved_to_account, key: :moved, serializer: REST::AccountSerializer, if: :moved_and_not_nested? diff --git a/db/migrate/20260217154542_add_profile_settings_to_accounts.rb b/db/migrate/20260217154542_add_profile_settings_to_accounts.rb new file mode 100644 index 0000000000..dc30575676 --- /dev/null +++ b/db/migrate/20260217154542_add_profile_settings_to_accounts.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddProfileSettingsToAccounts < ActiveRecord::Migration[8.0] + def change + add_column :accounts, :show_media, :boolean, null: false, default: true + add_column :accounts, :show_media_replies, :boolean, null: false, default: true + add_column :accounts, :show_featured, :boolean, null: false, default: true + end +end diff --git a/db/schema.rb b/db/schema.rb index 470b3e1efe..8a53b24d0a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[8.0].define(version: 2026_02_12_131934) do +ActiveRecord::Schema[8.0].define(version: 2026_02_17_154542) do # These are extensions that must be enabled in order to support this database enable_extension "pg_catalog.plpgsql" @@ -203,6 +203,9 @@ ActiveRecord::Schema[8.0].define(version: 2026_02_12_131934) do t.integer "feature_approval_policy", default: 0, null: false t.string "avatar_description", default: "", null: false t.string "header_description", default: "", null: false + t.boolean "show_media", default: true, null: false + t.boolean "show_media_replies", default: true, null: false + t.boolean "show_featured", default: true, null: false t.index "(((setweight(to_tsvector('simple'::regconfig, (display_name)::text), 'A'::\"char\") || setweight(to_tsvector('simple'::regconfig, (username)::text), 'B'::\"char\")) || setweight(to_tsvector('simple'::regconfig, (COALESCE(domain, ''::character varying))::text), 'C'::\"char\")))", name: "search_index", using: :gin t.index "lower((username)::text), COALESCE(lower((domain)::text), ''::text)", name: "index_accounts_on_username_and_domain_lower", unique: true t.index ["domain", "id"], name: "index_accounts_on_domain_and_id"