lib/happymapper.rb in nokogiri-happymapper-0.5.4 vs lib/happymapper.rb in nokogiri-happymapper-0.5.5

- old
+ new

@@ -5,11 +5,11 @@ class Boolean; end class XmlContent; end module HappyMapper - VERSION = "0.5.4" + VERSION = "0.5.5" DEFAULT_NS = "happymapper" def self.included(base) base.instance_variable_set("@attributes", {}) @@ -477,10 +477,10 @@ # # Attributes that have a nil value should be ignored unless they explicitly # state that they should be expressed in the output. # - if value || attribute.options[:state_when_nil] + if not value.nil? || attribute.options[:state_when_nil] attribute_namespace = attribute.options[:namespace] || default_namespace [ "#{attribute_namespace ? "#{attribute_namespace}:" : ""}#{attribute.tag}", value ] else [] end