From d9cf2b57fddc220946e0b8723811c1356736787c Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Mon, 3 Feb 2020 15:48:49 +0100 Subject: [PATCH] Fix failing tests [SCI-4220] --- app/models/repository_checklist_item.rb | 3 ++- app/models/repository_list_item.rb | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/models/repository_checklist_item.rb b/app/models/repository_checklist_item.rb index bf16b9181..604fff293 100644 --- a/app/models/repository_checklist_item.rb +++ b/app/models/repository_checklist_item.rb @@ -18,7 +18,8 @@ class RepositoryChecklistItem < ApplicationRecord private def validate_per_column_limit - if repository_column.repository_checklist_items.count > Constants::REPOSITORY_CHECKLIST_ITEMS_PER_COLUMN + if repository_column && + repository_column.repository_checklist_items.count > Constants::REPOSITORY_CHECKLIST_ITEMS_PER_COLUMN errors.add(:base, :per_column_limit) end end diff --git a/app/models/repository_list_item.rb b/app/models/repository_list_item.rb index c4811b950..8c6e4e2f8 100644 --- a/app/models/repository_list_item.rb +++ b/app/models/repository_list_item.rb @@ -15,7 +15,8 @@ class RepositoryListItem < ApplicationRecord private def validate_per_column_limit - if repository_column.repository_list_items.count > Constants::REPOSITORY_LIST_ITEMS_PER_COLUMN + if repository_column && + repository_column.repository_list_items.count > Constants::REPOSITORY_LIST_ITEMS_PER_COLUMN errors.add(:base, :per_column_limit) end end