From 99ab4e36d3d777943b471d854c0729ba6c040df0 Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Sun, 14 Oct 2012 08:55:46 +0900 Subject: updated serialized_attributes to reject nil values --- lib/axlsx/util/serialized_attributes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/axlsx/util/serialized_attributes.rb b/lib/axlsx/util/serialized_attributes.rb index dd67f75b..85a7feba 100644 --- a/lib/axlsx/util/serialized_attributes.rb +++ b/lib/axlsx/util/serialized_attributes.rb @@ -17,7 +17,7 @@ module Axlsx def serialized_attributes(str = '', additional_attributes = {}) key_value_pairs = instance_values.select do |key, value| - self.class.xml_attributes.include?(key.to_sym) + self.class.xml_attributes.include?(key.to_sym) && value != nil end key_value_pairs.merge! additional_attributes key_value_pairs.each do |key, value| -- cgit v1.2.3