mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Do no use string in if conditional
Passing string to be evaluated in :if and :unless conditional options is not supported. Pass a symbol for an instance method, or a lambda, proc or block, instead.
This commit is contained in:
parent
254d8cb9fd
commit
af1d5e4a3b
1 changed files with 1 additions and 1 deletions
|
|
@ -10,7 +10,7 @@ class SurveyQuestion < ActiveRecord::Base
|
|||
ICONS = { boolean: 'dot-circle-o', choice: 'check-square-o', string: 'edit', text: 'align-left', datetime: 'clock-o', numeric: 'slack' }.freeze
|
||||
|
||||
validates :title, presence: true
|
||||
validates :possible_answers, :max_choices, :min_choices, presence: true, if: 'choice?'
|
||||
validates :possible_answers, :max_choices, :min_choices, presence: true, if: :choice?
|
||||
validates :min_choices, numericality: { greater_than_or_equal_to: 1 }, allow_blank: true
|
||||
validates :max_choices, numericality: { greater_than_or_equal_to: 1 }, allow_blank: true
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue