diff --git a/db/migrate/20210222123823_migrate_to_new_user_roles.rb b/db/migrate/20210222123823_migrate_to_new_user_roles.rb index b7fccc161..dcd56ff01 100644 --- a/db/migrate/20210222123823_migrate_to_new_user_roles.rb +++ b/db/migrate/20210222123823_migrate_to_new_user_roles.rb @@ -54,6 +54,16 @@ class MigrateToNewUserRoles < ActiveRecord::Migration[6.1] user_assignments << UserAssignment.new(user: user_project.user, assignable: user_project.project, user_role: user_role) + user_project.project.experiments.each do |experiment| + user_assignments << UserAssignment.new(user: user_project.user, + assignable: experiment, + user_role: user_role) + experiment.my_modules.each do |my_module| + user_assignments << UserAssignment.new(user: user_project.user, + assignable: my_module, + user_role: user_role) + end + end end UserAssignment.import(user_assignments) end