unepwcmc/SAPI — pull request #314 by agnessa (2014-05-08 12:09:26+00:00)
Title: Fix auto complete order for trade

this fixes the following issues with the auto complete:
- in the public interface, appends 'spp' to higher taxa in auto complete suggestions within the 'Taxon' field (this is done in javascript and because the search runs on ids, the backend is not affected)
- in the public interface sort suggestions by full_name. taxonomic position is not reliable for trade names and hybrids, full name should do the trick
- in all other interfaces the ordering was previously done based on a derivative of taxon.taxonomic position, which was causing weird issues with internal trade where that order was incorrect for hybrids and trade names. changed that to use the rank.taxonomic_position field instead.

rake db:migrate
select * from rebuild_taxon_concepts_mview()