diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index c37a02dfa..7f70e2dac 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -335,7 +335,7 @@ class ProjectsController < ApplicationController .permit( :name, :team_id, :visibility, :archived, :project_folder_id, - :group_user_role_id + :default_public_user_role_id ) end diff --git a/app/jobs/user_assignments/group_assignment_job.rb b/app/jobs/user_assignments/group_assignment_job.rb index 6b6aa613c..2e4cd8587 100644 --- a/app/jobs/user_assignments/group_assignment_job.rb +++ b/app/jobs/user_assignments/group_assignment_job.rb @@ -13,7 +13,7 @@ module UserAssignments UserAssignment.create!( user: user, assignable: project, - user_role: project.group_user_role, + user_role: project.default_public_user_role, assigned_by: @assigned_by, assigned: :automatically ) @@ -21,7 +21,7 @@ module UserAssignments UserAssignments::PropagateAssignmentJob.perform_later( project, user, - project.group_user_role, + project.default_public_user_role, @assigned_by ) end diff --git a/app/models/project.rb b/app/models/project.rb index 3b514ce70..d3fa4c9a0 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -37,8 +37,8 @@ class Project < ApplicationRecord foreign_key: 'restored_by_id', class_name: 'User', optional: true - belongs_to :group_user_role, - foreign_key: 'group_user_role_id', + belongs_to :default_public_user_role, + foreign_key: 'default_public_user_role_id', class_name: 'UserRole', optional: true belongs_to :team, inverse_of: :projects, touch: true @@ -327,11 +327,11 @@ class Project < ApplicationRecord end def bulk_assignment? - visible? && group_user_role.present? + visible? && default_public_user_role.present? end def selected_user_role_validation - errors.add(:group_user_role_id, :inclusion) unless group_user_role.in?(UserRole.all) + errors.add(:default_public_user_role_id, :inclusion) unless default_public_user_role.in?(UserRole.all) end def sync_project_assignments diff --git a/app/views/projects/index/modals/_edit_project_contents.html.erb b/app/views/projects/index/modals/_edit_project_contents.html.erb index f184e73be..31c140ecd 100644 --- a/app/views/projects/index/modals/_edit_project_contents.html.erb +++ b/app/views/projects/index/modals/_edit_project_contents.html.erb @@ -25,8 +25,8 @@
- <%= f.select :group_user_role_id, - options_for_select(user_roles_collection, selected: f.object.group_user_role_id), + <%= f.select :default_public_user_role_id, + options_for_select(user_roles_collection, selected: f.object.default_public_user_role_id), { label: t('user_assignment.select_default_user_role') }, class: 'form-control selectpicker'%>
diff --git a/app/views/projects/index/modals/_new_project.html.erb b/app/views/projects/index/modals/_new_project.html.erb index fee45a4c4..81fcf3bfc 100644 --- a/app/views/projects/index/modals/_new_project.html.erb +++ b/app/views/projects/index/modals/_new_project.html.erb @@ -25,7 +25,7 @@