Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-18 14:46:11 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-19 19:58:28 +0300
commit2f7260b460f2a893241039115a201c2522fb47ca (patch)
treea2f5414a5ffe3e62badce5727abcbf80008ba36e /app/models/project_label.rb
parentf0ad0ceff5236f3ee5babee47bfec217a54c3b07 (diff)
Fix max number of permitted priorities per project label
Diffstat (limited to 'app/models/project_label.rb')
-rw-r--r--app/models/project_label.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/project_label.rb b/app/models/project_label.rb
index 0a79521ed09..33c2b617715 100644
--- a/app/models/project_label.rb
+++ b/app/models/project_label.rb
@@ -1,5 +1,5 @@
class ProjectLabel < Label
- NUMBER_OF_PRIORITIES = 1
+ MAX_NUMBER_OF_PRIORITIES = 1
belongs_to :project
@@ -27,7 +27,7 @@ class ProjectLabel < Label
end
def permitted_numbers_of_priorities
- if priorities && priorities.size >= NUMBER_OF_PRIORITIES
+ if priorities && priorities.size > MAX_NUMBER_OF_PRIORITIES
errors.add(:priorities, 'Number of permitted priorities exceeded')
end
end