Merge remote-tracking branch 'parent/main' into upstream-20240913

This commit is contained in:
KMY 2024-09-13 10:31:48 +09:00
commit fc9d27ff91
392 changed files with 3757 additions and 3233 deletions

View file

@ -55,6 +55,7 @@
# remote_pending :boolean default(FALSE), not null
# avatar_file_size :integer
# header_file_size :integer
# attribution_domains :string default([]), is an Array
#
class Account < ApplicationRecord
@ -94,6 +95,7 @@ class Account < ApplicationRecord
include Account::StatusesSearch
include Account::OtherSettings
include Account::MasterSettings
include Account::AttributionDomains
include DomainMaterializable
include DomainNormalizable
include Paginable
@ -118,10 +120,12 @@ class Account < ApplicationRecord
validates :display_name, length: { maximum: DISPLAY_NAME_LENGTH_LIMIT }, if: -> { local? && will_save_change_to_display_name? }
validates :note, note_length: { maximum: NOTE_LENGTH_LIMIT }, if: -> { local? && will_save_change_to_note? }
validates :fields, length: { maximum: DEFAULT_FIELDS_SIZE }, if: -> { local? && will_save_change_to_fields? }
validates :uri, absence: true, if: :local?, on: :create
validates :inbox_url, absence: true, if: :local?, on: :create
validates :shared_inbox_url, absence: true, if: :local?, on: :create
validates :followers_url, absence: true, if: :local?, on: :create
with_options on: :create do
validates :uri, absence: true, if: :local?
validates :inbox_url, absence: true, if: :local?
validates :shared_inbox_url, absence: true, if: :local?
validates :followers_url, absence: true, if: :local?
end
normalizes :username, with: ->(username) { username.squish }