Add survey related tests
This commit is contained in:
parent
68a8ec2204
commit
c278e547ce
8 changed files with 198 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
class SurveyQuestion < ActiveRecord::Base
|
||||
belongs_to :survey
|
||||
has_many :survey_replies
|
||||
|
||||
# Order of this list should not be changed without proper action!
|
||||
enum kind: [:boolean, :choice, :string, :text, :datetime, :numeric]
|
||||
|
|
@ -12,7 +13,6 @@ class SurveyQuestion < ActiveRecord::Base
|
|||
validates :max_choices, numericality: { greater_than_or_equal_to: 1 }, allow_blank: true
|
||||
|
||||
validate :max_choices_greater_than_min
|
||||
has_many :survey_replies
|
||||
|
||||
def single_choice?
|
||||
choice? && max_choices == 1 && min_choices == 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue