Remove invalid designated users when moving experiment [SCI-6335] (#3722)

This commit is contained in:
artoscinote 2021-12-06 14:27:26 +01:00 committed by GitHub
parent 561746158e
commit c80cbe34f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,6 +31,7 @@ module Experiments
raise
end
sync_user_assignments(my_module)
clean_up_user_my_modules(my_module)
move_tags!(my_module)
end
@ -119,6 +120,10 @@ module Experiments
UserAssignments::GenerateUserAssignmentsJob.perform_later(object, @user)
end
def clean_up_user_my_modules(my_module)
my_module.user_my_modules.where.not(user_id: @project.users.select(:id)).destroy_all
end
def track_activity
Activities::CreateActivityService
.call(activity_type: :move_experiment,