Welcome to mirror list, hosted at ThFree Co, Russian Federation.

recalculate_for_user_range_service.rb « authorized_project_update « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f300c45f019c8835c9737ceae6a79940714302d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

module AuthorizedProjectUpdate
  class RecalculateForUserRangeService
    def initialize(start_user_id, end_user_id)
      @start_user_id = start_user_id
      @end_user_id = end_user_id
    end

    def execute
      User.where(id: start_user_id..end_user_id).select(:id).find_each do |user| # rubocop: disable CodeReuse/ActiveRecord
        Users::RefreshAuthorizedProjectsService.new(user, source: self.class.name).execute
      end
    end

    private

    attr_reader :start_user_id, :end_user_id
  end
end