This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/jobs/regular/refresh_users_reviewable_counts.rb
2023-01-09 14:14:59 +00:00

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