mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-12 09:20:45 +08:00
Improve limit check for repository list and checklist items [SCI-5238]
This commit is contained in:
parent
bc5221d4a7
commit
1a38b34b94
2 changed files with 2 additions and 2 deletions
|
|
@ -18,7 +18,7 @@ class RepositoryChecklistItem < ApplicationRecord
|
||||||
|
|
||||||
def validate_per_column_limit
|
def validate_per_column_limit
|
||||||
if repository_column &&
|
if repository_column &&
|
||||||
repository_column.repository_checklist_items.count > Constants::REPOSITORY_CHECKLIST_ITEMS_PER_COLUMN
|
repository_column.repository_checklist_items.size > Constants::REPOSITORY_CHECKLIST_ITEMS_PER_COLUMN
|
||||||
errors.add(:base, :per_column_limit)
|
errors.add(:base, :per_column_limit)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ class RepositoryListItem < ApplicationRecord
|
||||||
|
|
||||||
def validate_per_column_limit
|
def validate_per_column_limit
|
||||||
if repository_column &&
|
if repository_column &&
|
||||||
repository_column.repository_list_items.count > Constants::REPOSITORY_LIST_ITEMS_PER_COLUMN
|
repository_column.repository_list_items.size > Constants::REPOSITORY_LIST_ITEMS_PER_COLUMN
|
||||||
errors.add(:base, :per_column_limit)
|
errors.add(:base, :per_column_limit)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue