Merge commit '9e245d147bcb2c72cc552ff8c276a1c34e2f686d' into glitch-soc/merge-upstream
Conflicts: - `app/views/settings/profiles/show.html.haml`: Upstream redesigned the settings page, where glitch-soc had changes because of the ability to set some custom limits. Went with upstream's design while keeping our custom limits. - `yarn.lock`: Upstream updated dependencies textually close to a glitch-soc-only dependency. Updated the dependnencies as well.
This commit is contained in:
@@ -43,22 +43,21 @@ class AccountConversation < ApplicationRecord
|
||||
end
|
||||
|
||||
class << self
|
||||
def to_a_paginated_by_id(limit, min_id: nil, max_id: nil, since_id: nil, preload_participants: true)
|
||||
def to_a_paginated_by_id(limit, options = {})
|
||||
array = begin
|
||||
if min_id
|
||||
paginate_by_min_id(limit, min_id, max_id).reverse
|
||||
if options[:min_id]
|
||||
paginate_by_min_id(limit, options[:min_id], options[:max_id]).reverse
|
||||
else
|
||||
paginate_by_max_id(limit, max_id, since_id).to_a
|
||||
paginate_by_max_id(limit, options[:max_id], options[:since_id]).to_a
|
||||
end
|
||||
end
|
||||
|
||||
if preload_participants
|
||||
participant_ids = array.flat_map(&:participant_account_ids)
|
||||
accounts_by_id = Account.where(id: participant_ids).index_by(&:id)
|
||||
# Preload participants
|
||||
participant_ids = array.flat_map(&:participant_account_ids)
|
||||
accounts_by_id = Account.where(id: participant_ids).index_by(&:id)
|
||||
|
||||
array.each do |conversation|
|
||||
conversation.participant_accounts = conversation.participant_account_ids.filter_map { |id| accounts_by_id[id] }
|
||||
end
|
||||
array.each do |conversation|
|
||||
conversation.participant_accounts = conversation.participant_account_ids.filter_map { |id| accounts_by_id[id] }
|
||||
end
|
||||
|
||||
array
|
||||
|
@@ -26,6 +26,7 @@ class Admin::AccountAction
|
||||
alias include_statuses? include_statuses
|
||||
|
||||
validates :type, :target_account, :current_account, presence: true
|
||||
validates :type, inclusion: { in: TYPES }
|
||||
|
||||
def initialize(attributes = {})
|
||||
@send_email_notification = true
|
||||
@@ -71,6 +72,10 @@ class Admin::AccountAction
|
||||
TYPES - %w(none disable)
|
||||
end
|
||||
end
|
||||
|
||||
def i18n_scope
|
||||
:activerecord
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
Reference in New Issue
Block a user