Class: AuthorizedProjectUpdate::RecalculateForUserRangeService

Inherits:
Object
  • Object
show all
Defined in:
app/services/authorized_project_update/recalculate_for_user_range_service.rb

Instance Method Summary collapse

Constructor Details

#initialize(start_user_id, end_user_id) ⇒ RecalculateForUserRangeService

Returns a new instance of RecalculateForUserRangeService.


5
6
7
8
# File 'app/services/authorized_project_update/recalculate_for_user_range_service.rb', line 5

def initialize(start_user_id, end_user_id)
  @start_user_id = start_user_id
  @end_user_id = end_user_id
end

Instance Method Details

#executeObject


10
11
12
13
14
# File 'app/services/authorized_project_update/recalculate_for_user_range_service.rb', line 10

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).execute
  end
end