mirror of
https://github.com/mastodon/mastodon.git
synced 2025-07-14 08:18:15 +00:00
Compare commits
6 Commits
c6bcabc44a
...
3b7099bcdf
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3b7099bcdf | ||
![]() |
7a21ff2088 | ||
![]() |
823ed7ad15 | ||
![]() |
8d7ba830f5 | ||
![]() |
dded2f01b3 | ||
![]() |
e0e58ab9cf |
|
@ -52,7 +52,9 @@ class StatusesIndex < Chewy::Index
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
index_scope ::Status.unscoped.kept.without_reblogs.includes(:media_attachments, :local_mentioned, :local_favorited, :local_reblogged, :local_bookmarked, :tags, preview_cards_status: :preview_card, preloadable_poll: :local_voters), delete_if: ->(status) { status.searchable_by.empty? }
|
index_scope ::Status.unscoped.kept.without_reblogs.includes(
|
||||||
|
:media_attachments, :local_mentioned, :local_favorited, :local_reblogged, :local_bookmarked, :local_replied, :tags, preview_cards_status: :preview_card, preloadable_poll: :local_voters
|
||||||
|
), delete_if: ->(status) { status.searchable_by.empty? }
|
||||||
|
|
||||||
root date_detection: false do
|
root date_detection: false do
|
||||||
field(:id, type: 'long')
|
field(:id, type: 'long')
|
||||||
|
|
|
@ -55,6 +55,7 @@ class Importer::StatusesIndexImporter < Importer::BaseImporter
|
||||||
local_favourites_scope,
|
local_favourites_scope,
|
||||||
local_votes_scope,
|
local_votes_scope,
|
||||||
local_bookmarks_scope,
|
local_bookmarks_scope,
|
||||||
|
local_replied_scope,
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -77,4 +78,8 @@ class Importer::StatusesIndexImporter < Importer::BaseImporter
|
||||||
def local_statuses_scope
|
def local_statuses_scope
|
||||||
Status.local.select('"statuses"."id", COALESCE("statuses"."reblog_of_id", "statuses"."id") AS status_id')
|
Status.local.select('"statuses"."id", COALESCE("statuses"."reblog_of_id", "statuses"."id") AS status_id')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def local_replied_scope
|
||||||
|
Status.local.where.not(in_reply_to_id: nil).where('in_reply_to_account_id != account_id').select(:id, 'in_reply_to_id AS status_id')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,6 +17,7 @@ module Status::SearchConcern
|
||||||
ids += local_favorited.pluck(:id)
|
ids += local_favorited.pluck(:id)
|
||||||
ids += local_reblogged.pluck(:id)
|
ids += local_reblogged.pluck(:id)
|
||||||
ids += local_bookmarked.pluck(:id)
|
ids += local_bookmarked.pluck(:id)
|
||||||
|
ids += local_replied.pluck(:id)
|
||||||
ids += preloadable_poll.local_voters.pluck(:id) if preloadable_poll.present?
|
ids += preloadable_poll.local_voters.pluck(:id) if preloadable_poll.present?
|
||||||
|
|
||||||
ids.uniq
|
ids.uniq
|
||||||
|
|
|
@ -93,6 +93,7 @@ class Status < ApplicationRecord
|
||||||
has_many :local_favorited, -> { merge(Account.local) }, through: :favourites, source: :account
|
has_many :local_favorited, -> { merge(Account.local) }, through: :favourites, source: :account
|
||||||
has_many :local_reblogged, -> { merge(Account.local) }, through: :reblogs, source: :account
|
has_many :local_reblogged, -> { merge(Account.local) }, through: :reblogs, source: :account
|
||||||
has_many :local_bookmarked, -> { merge(Account.local) }, through: :bookmarks, source: :account
|
has_many :local_bookmarked, -> { merge(Account.local) }, through: :bookmarks, source: :account
|
||||||
|
has_many :local_replied, -> { merge(Account.local) }, through: :replies, source: :account
|
||||||
|
|
||||||
has_and_belongs_to_many :tags # rubocop:disable Rails/HasAndBelongsToMany
|
has_and_belongs_to_many :tags # rubocop:disable Rails/HasAndBelongsToMany
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user