Add new profile settings (#37890)
This commit is contained in:
@@ -46,6 +46,9 @@
|
|||||||
# reviewed_at :datetime
|
# reviewed_at :datetime
|
||||||
# sensitized_at :datetime
|
# sensitized_at :datetime
|
||||||
# shared_inbox_url :string default(""), not null
|
# 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
|
# silenced_at :datetime
|
||||||
# suspended_at :datetime
|
# suspended_at :datetime
|
||||||
# suspension_origin :integer
|
# suspension_origin :integer
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ class REST::AccountSerializer < ActiveModel::Serializer
|
|||||||
|
|
||||||
attributes :id, :username, :acct, :display_name, :locked, :bot, :discoverable, :indexable, :group, :created_at,
|
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,
|
: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?
|
has_one :moved_to_account, key: :moved, serializer: REST::AccountSerializer, if: :moved_and_not_nested?
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# 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
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "pg_catalog.plpgsql"
|
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.integer "feature_approval_policy", default: 0, null: false
|
||||||
t.string "avatar_description", default: "", null: false
|
t.string "avatar_description", default: "", null: false
|
||||||
t.string "header_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 "(((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 "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"
|
t.index ["domain", "id"], name: "index_accounts_on_domain_and_id"
|
||||||
|
|||||||
Reference in New Issue
Block a user