alphagov/trade-tariff-backend — pull request #88 by sauliusg (2013-06-27 11:48:51+00:00)
Title: Fix commodity ancestor selection

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.