lib/input_sanitizer/sanitizer.rb in input_sanitizer-0.1.8 vs lib/input_sanitizer/sanitizer.rb in input_sanitizer-0.1.9
- old
+ new
@@ -43,9 +43,14 @@
:integer => InputSanitizer::IntegerConverter.new,
:string => InputSanitizer::StringConverter.new,
:date => InputSanitizer::DateConverter.new,
:time => InputSanitizer::TimeConverter.new,
:boolean => InputSanitizer::BooleanConverter.new,
+ :integer_or_blank => InputSanitizer::IntegerConverter.new.extend(InputSanitizer::AllowNil),
+ :string_or_blank => InputSanitizer::StringConverter.new.extend(InputSanitizer::AllowNil),
+ :date_or_blank => InputSanitizer::DateConverter.new.extend(InputSanitizer::AllowNil),
+ :time_or_blank => InputSanitizer::TimeConverter.new.extend(InputSanitizer::AllowNil),
+ :boolean_or_blank => InputSanitizer::BooleanConverter.new.extend(InputSanitizer::AllowNil),
}
end
def self.inherited(subclass)
subclass.fields = self.fields.dup