diff --git a/app/models/project_folder.rb b/app/models/project_folder.rb index 508a8a656..f529f7c0e 100644 --- a/app/models/project_folder.rb +++ b/app/models/project_folder.rb @@ -8,7 +8,7 @@ class ProjectFolder < ApplicationRecord validates :name, length: { minimum: Constants::NAME_MIN_LENGTH, maximum: Constants::NAME_MAX_LENGTH }, - uniqueness: { scope: %i(team_id parent_folder_id), case_sensitive: false } + uniqueness: { scope: %i(team_id parent_folder_id archived), case_sensitive: false } validate :parent_folder_team, if: -> { parent_folder.present? } validate :parent_folder_validation, if: -> { parent_folder.present? } diff --git a/spec/models/project_folder_spec.rb b/spec/models/project_folder_spec.rb index 81e733fa2..2f231bb5e 100644 --- a/spec/models/project_folder_spec.rb +++ b/spec/models/project_folder_spec.rb @@ -37,7 +37,8 @@ describe ProjectFolder, type: :model do .is_at_most(Constants::NAME_MAX_LENGTH)) end it do - expect(project_folder).to validate_uniqueness_of(:name).scoped_to(%i(team_id parent_folder_id)).case_insensitive + expect(project_folder) + .to validate_uniqueness_of(:name).scoped_to(%i(team_id parent_folder_id archived)).case_insensitive end end