lib/active_model/form/attributes.rb in activemodel-form-0.0.2 vs lib/active_model/form/attributes.rb in activemodel-form-0.0.3
- old
+ new
@@ -64,10 +64,10 @@
module StringAttribute
def self.parse(v)
if v.present?
String.new(v)
- elsif ['', nil].include? v
+ elsif ['', nil].include? v.to_s.strip
nil
else
raise "Couldn't parse string attribute value: '#{v}'"
end
end