From 748f4dc5779690ee82d46f055111e065fc597c0b Mon Sep 17 00:00:00 2001 From: p31729568 Date: Wed, 3 Jul 2019 16:04:52 +0800 Subject: [PATCH] fix users subject repeat bug --- app/services/users/subject_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/users/subject_service.rb b/app/services/users/subject_service.rb index 7e3eaaa81..745b7cce2 100644 --- a/app/services/users/subject_service.rb +++ b/app/services/users/subject_service.rb @@ -14,7 +14,7 @@ class Users::SubjectService subjects = category_scope_subjects subjects = user_policy_filter(subjects) - custom_sort(subjects, :updated_at, params[:sort_direction]) + custom_sort(subjects.distinct, :updated_at, params[:sort_direction]) end private