increase poll option limit to 25, text limit to 150, and allow single option polls
This commit is contained in:
parent
acc8db28c3
commit
dd9c46a619
1 changed files with 2 additions and 2 deletions
|
@ -1,8 +1,8 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class PollOptionsValidator < ActiveModel::Validator
|
||||
MAX_OPTIONS = 4
|
||||
MAX_OPTION_CHARS = 50
|
||||
MAX_OPTIONS = 25
|
||||
MAX_OPTION_CHARS = 150
|
||||
|
||||
def validate(poll)
|
||||
poll.errors.add(:options, I18n.t('polls.errors.too_few_options')) unless poll.options.size > 1
|
||||
|
|
Loading…
Add table
Reference in a new issue