Update poll_options_validator.rb

Fix defaults to upstream mastodon values instead of glitch-soc
This commit is contained in:
Zee Aslam 2025-06-25 19:08:28 -04:00 committed by GitHub
parent 553642b43f
commit aa6a77fa1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,9 +1,8 @@
# frozen_string_literal: true
class PollOptionsValidator < ActiveModel::Validator
MAX_OPTION_CHARS = 50
MAX_OPTIONS = (ENV['MAX_POLL_OPTIONS'] || 5).to_i
MAX_OPTION_CHARS = (ENV['MAX_POLL_OPTION_CHARS'] || 100).to_i
MAX_OPTIONS = (ENV['MAX_POLL_OPTIONS'] || 4).to_i
MAX_OPTION_CHARS = (ENV['MAX_POLL_OPTION_CHARS'] || 50).to_i
def validate(poll)
poll.errors.add(:options, I18n.t('polls.errors.too_few_options')) unless poll.options.size > 1