randym/axlsx — pull request #285 by saaji (2014-02-13 18:01:44+00:00)
Title: Do not camelize underscores on DefinedNames

Recently I've stumbled upon the bug in current axlsx that prevents simple enough auto_filter from working (taken from the [gist](https://gist.github.com/randym/3179305)):

```ruby
wb.add_worksheet(:name => "Auto Filter") do |sheet|
sheet.add_row ["Build Matrix"]
sheet.add_row ["Build", "Duration", "Finished", "Rvm"]
sheet.add_row ["19.1", "1 min 32 sec", "about 10 hours ago", "1.8.7"]
sheet.add_row ["19.2", "1 min 28 sec", "about 10 hours ago", "1.9.2"]
sheet.add_row ["19.3", "1 min 35 sec", "about 10 hours ago", "1.9.3"]
sheet.auto_filter = "A2:D5"
end
```

The code above generates the example file successfully, however, trying to do sorting in auto filter makes Excel crash. This is 100% reproducible on MS Office 11 for Mac v. 14.3.9.

I've spent some considerable time to track it down, but long story short is that according to the [comment](https://github.com/randym/axlsx/issues/57#issuecomment-4655851) in #57, in order for auto_filter to work, the DefinedName should be added to workbook.xml, i.e

```xml

Table!$A$2:$D$5

```

Current Axlsx attribute serialization is trying to camelize attribute names, which makes the code above to render as

```xml

Table!$A$2:$D$5

```

and thus breaks the auto_filter functionality.

The proposed fix turns off camelization for DefinedNames. This fixes crashing auto_filter and potentially other issues related to DefinedNames. Tests included.