diff --git a/app/controllers/access_permissions/protocols_controller.rb b/app/controllers/access_permissions/protocols_controller.rb index 0a78bfdbb..88885fe27 100644 --- a/app/controllers/access_permissions/protocols_controller.rb +++ b/app/controllers/access_permissions/protocols_controller.rb @@ -99,7 +99,7 @@ module AccessPermissions @protocol.assign_attributes(permitted_default_public_user_role_params) @protocol.save! - UserAssignments::ProjectGroupAssignmentJob.perform_later(current_team, @project, current_user) + UserAssignments::ProtocolGroupAssignmentJob.perform_later(current_team, @protocol, current_user) end end diff --git a/app/models/team.rb b/app/models/team.rb index 4aba32b53..f9ac0cb6b 100644 --- a/app/models/team.rb +++ b/app/models/team.rb @@ -38,9 +38,9 @@ class Team < ApplicationRecord has_many :protocols, inverse_of: :team, dependent: :destroy has_many :repository_protocols, (lambda do - where(protocol_type: [Protocol.protocol_types[:in_repository_public], - Protocol.protocol_types[:in_repository_private], - Protocol.protocol_types[:in_repository_archived]]) + where(protocol_type: %i(in_repository_published_original + in_repository_draft + in_repository_published_version)) end), class_name: 'Protocol' has_many :protocol_keywords, inverse_of: :team, dependent: :destroy