Explorar o código

Added code to strip white spaces on fields for better length validation

Mathew Medoff %!s(int64=6) %!d(string=hai) anos
pai
achega
4ac935962b
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      lib/builder.rb

+ 1 - 1
lib/builder.rb

@@ -223,7 +223,7 @@ class CustomWizard::Builder
   end
 
   def validate_field(field, updater, step_template)
-    value = updater.fields[field['id']]
+    value = updater.fields[field['id']].strip
     min_length = field['min_length']
 
     if min_length && value.is_a?(String) && value.length < min_length.to_i