about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorleo60228 <leo@60228.dev>2021-01-23 13:15:27 -0500
committerThibG <thib@sitedethib.com>2021-01-26 14:07:31 +0100
commitca6c62068e35537251cc650c8b2d03a1a2163d06 (patch)
tree9bdc1f3ecce9d4798ecbf95dbc5e76a7874fceaf /app
parentd1255ab8a5101bc04af4a5214f975edf443a37d9 (diff)
Support customizing poll option limits
Diffstat (limited to 'app')
-rw-r--r--app/validators/poll_validator.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/validators/poll_validator.rb b/app/validators/poll_validator.rb
index 8259a62e5..1aaf5a5d0 100644
--- a/app/validators/poll_validator.rb
+++ b/app/validators/poll_validator.rb
@@ -1,8 +1,8 @@
 # frozen_string_literal: true
 
 class PollValidator < ActiveModel::Validator
-  MAX_OPTIONS      = 5
-  MAX_OPTION_CHARS = 100
+  MAX_OPTIONS      = (ENV['MAX_POLL_OPTIONS'] || 5).to_i
+  MAX_OPTION_CHARS = (ENV['MAX_POLL_OPTION_CHARS'] || 100).to_i
   MAX_EXPIRATION   = 1.month.freeze
   MIN_EXPIRATION   = 5.minutes.freeze