Create assignment after experiment move [SCI-6285] (#3689)

Co-authored-by: Anton <anton@scinote.net>
This commit is contained in:
aignatov-bio 2021-11-22 10:34:11 +01:00 committed by GitHub
parent a31bcd6eed
commit 8545b5787f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -107,6 +107,13 @@ module Experiments
# remove user assignments where the user are not present on the project
object.user_assignments.destroy_all
UserAssignment.create!(
user: @user,
assignable: object,
assigned: :automatically,
user_role: @project.user_assignments.find_by(user: @user).user_role
)
UserAssignments::GenerateUserAssignmentsJob.perform_later(object, @user)
end