This commit is contained in:
Nat 2025-03-28 00:52:20 +08:00
parent 6fcac2e86e
commit 5f8d43b97d
No known key found for this signature in database
GPG Key ID: 4938B35D927EC773
1 changed files with 3 additions and 5 deletions

View File

@ -241,11 +241,9 @@ after_initialize do
add_to_serializer(:user_card, :accepted_answers) do
DiscourseSolved::SolvedTopic
.joins(:topic, :answer_post)
.where("topics.archetype <> ?", Archetype.private_message)
.where(user_id: object.id)
.where("topics.deleted_at IS NULL")
.where("posts.deleted_at IS NULL")
.joins(answer_post: :user, topic: {})
.where(posts: { user_id: object.id, deleted_at: nil })
.where(topics: { archetype: Archetype.default, deleted_at: nil })
.count
end
add_to_serializer(:user_summary, :solved_count) { object.solved_count }