unepwcmc/SAPI — pull request #266 by agnessa (2014-03-19 09:02:28+00:00)
Title: fix to search by taxon in admin tool

An ActiveRecord::StatementInvalid occurred in taxon_concepts#index:

PG::AmbiguousColumn: ERROR: column reference "full_name" is ambiguous
LINE 1: ...AND "taxon_concepts"."taxonomy_id" = 1 AND (UPPER(full_name)...
^
: SELECT COUNT(DISTINCT count_column) FROM (SELECT "taxon_concepts"."id" AS count_column FROM "taxon_concepts" LEFT OUTER JOIN "ranks" ON "ranks"."id" = "taxon_concepts"."rank_id" LEFT OUTER JOIN "taxonomies" ON "taxonomies"."id" = "taxon_concepts"."taxonomy_id" LEFT OUTER JOIN "taxon_names" ON "taxon_names"."id" = "taxon_concepts"."taxon_name_id" LEFT OUTER JOIN "taxon_concepts" "parents_taxon_concepts" ON "parents_taxon_concepts"."id" = "taxon_concepts"."parent_id" WHERE "taxon_concepts"."name_status" = 'A' AND "taxon_concepts"."taxonomy_id" = 1 AND (UPPER(full_name) LIKE BTRIM(UPPER('Acanthastrea spp.%'))) LIMIT 25 OFFSET 0) subquery_for_count
activerecord (3.2.17) lib/active_record/connection_adapters/postgresql_adapter.rb:1163:in `exec'