bad q
This commit is contained in:
parent
6fcac2e86e
commit
5f8d43b97d
|
@ -241,11 +241,9 @@ after_initialize do
|
||||||
|
|
||||||
add_to_serializer(:user_card, :accepted_answers) do
|
add_to_serializer(:user_card, :accepted_answers) do
|
||||||
DiscourseSolved::SolvedTopic
|
DiscourseSolved::SolvedTopic
|
||||||
.joins(:topic, :answer_post)
|
.joins(answer_post: :user, topic: {})
|
||||||
.where("topics.archetype <> ?", Archetype.private_message)
|
.where(posts: { user_id: object.id, deleted_at: nil })
|
||||||
.where(user_id: object.id)
|
.where(topics: { archetype: Archetype.default, deleted_at: nil })
|
||||||
.where("topics.deleted_at IS NULL")
|
|
||||||
.where("posts.deleted_at IS NULL")
|
|
||||||
.count
|
.count
|
||||||
end
|
end
|
||||||
add_to_serializer(:user_summary, :solved_count) { object.solved_count }
|
add_to_serializer(:user_summary, :solved_count) { object.solved_count }
|
||||||
|
|
Loading…
Reference in New Issue