mirror of
https://github.com/discourse/discourse-solved.git
synced 2025-05-08 17:37:29 +00:00
There are three locations where a user's solution query is defined - user summary - user card - user directory This PR updates the queries to use data from the new `SolvedTopics` table instead of the `UserActions` table. And adds testssssss
13 lines
314 B
Ruby
13 lines
314 B
Ruby
# frozen_string_literal: true
|
|
|
|
module DiscourseSolved::UserSummaryExtension
|
|
extend ActiveSupport::Concern
|
|
|
|
def solved_count
|
|
DiscourseSolved::SolvedTopic
|
|
.joins("JOIN posts ON posts.id = discourse_solved_solved_topics.answer_post_id")
|
|
.where(posts: { user_id: @user.id })
|
|
.count
|
|
end
|
|
end
|