mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-06 18:01:05 +00:00
Update poll_options_validator.rb
Fix defaults to upstream mastodon values instead of glitch-soc
This commit is contained in:
parent
553642b43f
commit
aa6a77fa1b
|
@ -1,9 +1,8 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class PollOptionsValidator < ActiveModel::Validator
|
class PollOptionsValidator < ActiveModel::Validator
|
||||||
MAX_OPTION_CHARS = 50
|
MAX_OPTIONS = (ENV['MAX_POLL_OPTIONS'] || 4).to_i
|
||||||
MAX_OPTIONS = (ENV['MAX_POLL_OPTIONS'] || 5).to_i
|
MAX_OPTION_CHARS = (ENV['MAX_POLL_OPTION_CHARS'] || 50).to_i
|
||||||
MAX_OPTION_CHARS = (ENV['MAX_POLL_OPTION_CHARS'] || 100).to_i
|
|
||||||
|
|
||||||
def validate(poll)
|
def validate(poll)
|
||||||
poll.errors.add(:options, I18n.t('polls.errors.too_few_options')) unless poll.options.size > 1
|
poll.errors.add(:options, I18n.t('polls.errors.too_few_options')) unless poll.options.size > 1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user