Add MAX_POLL_OPTIONS

This commit is contained in:
bgme 2026-01-31 00:13:25 +08:00
parent de081c7930
commit 139ca60bb2
2 changed files with 7 additions and 2 deletions

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true
class PollOptionsValidator < ActiveModel::Validator
MAX_OPTIONS = 4
MAX_OPTIONS = (ENV['MAX_POLL_OPTIONS'] || 4).to_i
MAX_OPTION_CHARS = 50
def validate(poll)