Merge remote-tracking branch 'parent/main' into upstream-20240128
This commit is contained in:
commit
bd5b417d2b
107 changed files with 795 additions and 246 deletions
|
@ -26,6 +26,7 @@ class List < ApplicationRecord
|
|||
|
||||
has_many :list_accounts, inverse_of: :list, dependent: :destroy
|
||||
has_many :accounts, through: :list_accounts
|
||||
has_many :active_accounts, -> { merge(ListAccount.active) }, through: :list_accounts, source: :account
|
||||
has_many :antennas, inverse_of: :list, dependent: :destroy
|
||||
has_many :list_statuses, inverse_of: :list, dependent: :destroy
|
||||
has_many :statuses, through: :list_statuses
|
||||
|
|
|
@ -20,6 +20,8 @@ class ListAccount < ApplicationRecord
|
|||
validates :account_id, uniqueness: { scope: :list_id }
|
||||
validate :validate_relationship
|
||||
|
||||
scope :active, -> { where.not(follow_id: nil) }
|
||||
|
||||
before_validation :set_follow, unless: :list_owner_account_is_account?
|
||||
|
||||
private
|
||||
|
|
|
@ -37,7 +37,8 @@ class Poll < ApplicationRecord
|
|||
|
||||
validates :options, presence: true
|
||||
validates :expires_at, presence: true, if: :local?
|
||||
validates_with PollValidator, on: :create, if: :local?
|
||||
validates_with PollOptionsValidator, if: :local?
|
||||
validates_with PollExpirationValidator, if: -> { local? && expires_at_changed? }
|
||||
|
||||
before_validation :prepare_options, if: :local?
|
||||
before_validation :prepare_votes_count
|
||||
|
|
|
@ -68,6 +68,7 @@ class UserSettings
|
|||
setting :enable_emoji_reaction, default: true
|
||||
setting :show_emoji_reaction_on_timeline, default: true
|
||||
setting :reblog_modal, default: false
|
||||
setting :missing_alt_text_modal, default: true
|
||||
setting :reduce_motion, default: false
|
||||
setting :expand_content_warnings, default: false
|
||||
setting :display_media, default: 'default', in: %w(default show_all hide_all)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue