diff options
| author | Randy Morgan <[email protected]> | 2012-10-14 09:45:46 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-10-14 09:45:46 +0900 |
| commit | 87560296ccb05a4fb21461bc64aead272a5839b7 (patch) | |
| tree | 757395632a0cb97ae6f312566c2118bcdc6c53e0 /lib/axlsx/util/serialized_attributes.rb | |
| parent | fbd212ac7070627ec069f5e3a69d3e80475b6bf0 (diff) | |
| download | caxlsx-87560296ccb05a4fb21461bc64aead272a5839b7.tar.gz caxlsx-87560296ccb05a4fb21461bc64aead272a5839b7.zip | |
Patched serialized_attributes for 1.8.7
I really need to discontinue support for 1.8.7...
Diffstat (limited to 'lib/axlsx/util/serialized_attributes.rb')
| -rw-r--r-- | lib/axlsx/util/serialized_attributes.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/axlsx/util/serialized_attributes.rb b/lib/axlsx/util/serialized_attributes.rb index 85a7feba..59efbc9f 100644 --- a/lib/axlsx/util/serialized_attributes.rb +++ b/lib/axlsx/util/serialized_attributes.rb @@ -16,10 +16,13 @@ module Axlsx end def serialized_attributes(str = '', additional_attributes = {}) - key_value_pairs = instance_values.select do |key, value| - self.class.xml_attributes.include?(key.to_sym) && value != nil + key_value_pairs = instance_values + key_value_pairs.each do |key, value| + key_value_pairs.delete(key) if value == nil + key_value_pairs.delete(key) unless self.class.xml_attributes.include?(key.to_sym) end key_value_pairs.merge! additional_attributes + key_value_pairs.each do |key, value| str << "#{Axlsx.camel(key, false)}='#{value}' " end |
