mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 12:23:37 +08:00
3ff6f6a5e1
Users who can access the review queue can claim a pending reviewable(s) which means that the claimed reviewable(s) can only be handled by the user who claimed it. Currently, we show claimed reviewables in the user menu, but this can be annoying for other reviewers because they can't do anything about a reviewable claimed by someone. So this PR makes sure that we only show in the user menu reviewables that are claimed by nobody or claimed by the current user. Internal topic: t/77235.
12 lines
309 B
Ruby
12 lines
309 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Jobs::RefreshUsersReviewableCounts < ::Jobs::Base
|
|
def execute(args)
|
|
group_ids = args[:group_ids]
|
|
return if group_ids.blank?
|
|
User.where(
|
|
id: GroupUser.where(group_id: group_ids).distinct.pluck(:user_id)
|
|
).each(&:publish_reviewable_counts)
|
|
end
|
|
end
|