Sha256: 207e2024b13740c3af7c2de7b1df30864c9d386bc6115f6f5e10531fedd75b97
Contents?: true
Size: 635 Bytes
Versions: 10
Compression:
Stored size: 635 Bytes
Contents
module Rapidfire module Questions class Numeric < Rapidfire::Question def validate_answer(answer) super(answer) if rules[:presence] == "1" || answer.answer_text.present? gt_or_lt = {} if rules[:greater_than_or_equal_to].present? gt_or_lt[:greater_than_or_equal_to] = rules[:greater_than_or_equal_to].to_i end if rules[:less_than_or_equal_to].present? gt_or_lt[:less_than_or_equal_to] = rules[:less_than_or_equal_to].to_i end answer.validates_numericality_of :answer_text, gt_or_lt end end end end end
Version data entries
10 entries across 10 versions & 2 rubygems