Merge pull request #3139 from aignatov-bio/ai-sci-fix-merging-issue

Fix duplicate code
This commit is contained in:
aignatov-bio 2021-02-05 11:33:40 +01:00 committed by GitHub
commit 0330c265cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,9 +7,7 @@ class ProjectFolder < ApplicationRecord
validates :name,
length: { minimum: Constants::NAME_MIN_LENGTH,
maximum: Constants::NAME_MAX_LENGTH },
validates :name, length: { minimum: Constants::NAME_MIN_LENGTH,
maximum: Constants::NAME_MAX_LENGTH }
maximum: Constants::NAME_MAX_LENGTH }
validates :name, uniqueness: { scope: %i(team_id parent_folder_id), case_sensitive: false },
if: -> { parent_folder.present? }
validates :name, uniqueness: { scope: %i(team_id archived), case_sensitive: false },