Support customizing poll option limits

This commit is contained in:
leo60228 authored and ThibG committed 2021-01-26 14:07:31 +01:00
1 parent d1255ab8a5
commit ca6c62068e
2 files changed
+8 -2

No files matched your search

+2 -2
View File
@@ -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