mirror of
https://github.com/discourse/discourse-solved.git
synced 2025-05-08 01:18:57 +00:00
14 lines
360 B
Ruby
14 lines
360 B
Ruby
# frozen_string_literal: true
|
|
|
|
module DiscourseSolved::UserSummaryExtension
|
|
extend ActiveSupport::Concern
|
|
|
|
def solved_count
|
|
DiscourseSolved::SolvedTopic
|
|
.joins(answer_post: :user, topic: {})
|
|
.where(posts: { user_id: @user.id, deleted_at: nil })
|
|
.where(topics: { archetype: Archetype.default, deleted_at: nil })
|
|
.count
|
|
end
|
|
end
|