unepwcmc/SAPI — pull request #16 by agnessa (2013-02-11 14:08:03+00:00)
Title: Fix duplicate search results for split listed taxa

Fixed by replacing "joins" by "includes" in the checklist query. Unfortunately, from there followed other necessary changes, because with "includes" in place AR rewrites the entire query so that we no longer can take advantage of specifying select fields, This has a particular implication for the synonyms array with author names, which would be constructed on the fly within the select clause in the previous version. Now the approach has been simplified so that synonyms_ary and author_years_ary are merged in the MTaxonConcept model (rather than sql query) to return the list of synonyms_with_authors for the purposes of web output as well as json and csv.. The pdf query had to be amended, because it depends on sql sorting of scientific name, synonyms and common names.

In order to see the fix in the checklist interface youi need to use branch https://github.com/unepwcmc/cites-checklist/tree/fix_duplicate_search_results_for_split_listed_taxa