lib/iron/enum/attr_support.rb in iron-enum-1.0.2 vs lib/iron/enum/attr_support.rb in iron-enum-1.0.3
- old
+ new
@@ -120,9 +120,10 @@
def #{attr_field}
@#{attr_field}
end
def #{attr_field}=(val)
+ val = nil if val.is_a?(String) && val.empty?
@#{attr_field} = #{enum_klass}.value(val)
end
eos
end
\ No newline at end of file