fix text length validation

completes #64
This commit is contained in:
Mark Moser
2016-09-01 10:37:49 -05:00
parent df1b101aa2
commit a1b93f256d
3 changed files with 36 additions and 27 deletions

View File

@ -6,7 +6,7 @@ class AnswerFormatValidator < ActiveModel::EachValidator
private
def text record, attribute, value
clean_val = value.to_s.strip
clean_val = value.to_s.strip.delete("\r")
return if clean_val.length.between?(1, 1000)
if clean_val.blank?