From f3c1d123d471a03ff7a39f43a530abe5c3a08e52 Mon Sep 17 00:00:00 2001 From: aignatov-bio Date: Fri, 5 Feb 2021 11:28:38 +0100 Subject: [PATCH] Fix duplicate code --- app/models/project_folder.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/models/project_folder.rb b/app/models/project_folder.rb index acc4dbaf3..3d71bcb7c 100644 --- a/app/models/project_folder.rb +++ b/app/models/project_folder.rb @@ -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 },