0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-09 21:45:25 +08:00
discourse/plugins/discourse-solved/lib/discourse_solved/user_summary_extension.rb
Régis Hanol aa94311d97
DEV: refactor user card/summary accepted answer's query (#35500)
In
be5798f6d8
we standardized the way we counted a user's accepted answers.

This makes it a little bit more obvious by refactoring the query into it
own files (queries.rb) and using that in both the user card and user
summary serializers.

Also improved the specs coverage.

Internal ref - t/149121
2025-10-31 08:49:36 +01:00

9 lines
190 B
Ruby
Vendored

# frozen_string_literal: true
module DiscourseSolved::UserSummaryExtension
extend ActiveSupport::Concern
def solved_count
DiscourseSolved::Queries.solved_count(@user.id)
end
end