summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-02-09 16:52:20 +0100
committerDouwe Maan <douwe@selenight.nl>2016-02-09 16:52:20 +0100
commitf86ff1b833eb04dfc66638bdff110fa7cb9b2360 (patch)
tree9b7f80b9c936ee6f977e188dc3c4a62ca809db42 /app
parent706b101f510b9a1f5acff51bb2f1b14c018b37ce (diff)
parentdd3b9feafa958742d2772078309ede027720d4c0 (diff)
downloadgitlab-ce-f86ff1b833eb04dfc66638bdff110fa7cb9b2360.tar.gz
Merge branch 'fix/max-attachment-size-setting-validation'
Diffstat (limited to 'app')
-rw-r--r--app/models/application_setting.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb
index 44bbe5fb168..fa48fe5b9e4 100644
--- a/app/models/application_setting.rb
+++ b/app/models/application_setting.rb
@@ -93,6 +93,10 @@ class ApplicationSetting < ActiveRecord::Base
presence: true,
if: :akismet_enabled
+ validates :max_attachment_size,
+ presence: true,
+ numericality: { only_integer: true, greater_than: 0 }
+
validates_each :restricted_visibility_levels do |record, attr, value|
unless value.nil?
value.each do |level|