alphagov / trade-tariff-backend

Enabling the population and distribution via API of UK Customs tariffs and duties
MIT License
7 stars 6 forks source link

Fix commodity ancestor selection #88

Closed saulius closed 11 years ago

saulius commented 11 years ago

This change is a fix for https://www.pivotaltracker.com/story/show/52133375

We had one too many commodites in the tree on the commodity show page. The reason behind a bug is mainly how MySQL order and group by works (http://blog.chomperstomp.com/how-to-order-by-before-group-by-with-mysql/), i.e. they should happen in separate queries.