mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-28 11:14:24 +08:00
17 lines
449 B
Ruby
17 lines
449 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
module UserAssignments
|
||
|
class RemoveUserAssignmentJob < ApplicationJob
|
||
|
queue_as :high_priority
|
||
|
|
||
|
def perform(user, team)
|
||
|
ActiveRecord::Base.transaction do
|
||
|
team.projects.each do |project|
|
||
|
UserAssignments::PropagateAssignmentJob.perform_now(project, user, nil, nil, true)
|
||
|
UserAssignment.where(user: user, assignable: project).destroy_all
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|