randym/axlsx — pull request #213 by noniq (2013-07-05 02:29:33+00:00)
Title: Make relationship ids more reliable.

*[I made a pull request so you can review and comment on the changes – it’s a bit larger than the casual tiny bugfix :smiley:]*

Relationship instances now keep track of their own id – this should be much more reliable than the old way of more or less “guessing” the relationship id based on the position of some object in some array. Fixes https://github.com/randym/axlsx/issues/212, especially.

Each relationship now has its own, unique id – except for the cases when it doesn’t: Some relationships need to share the same id, see `Relation#should_use_same_id_as?` for the gory details.

All tests pass, and the full example.xlsx is generated without errors and looks fine in Excel for Mac 2011.

The pivot table example still has the problems mentioned in https://github.com/randym/axlsx/issues/168 – but as far as I can tell I didn’t make it worse (Excel is still be able to “repair” the file, and the repaired file contains the pivot table).