Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Taxa pointing to the same name objects, or having the same name_cache value #182
Comments
jonkerz
added a commit
to jonkerz/antcat
that referenced
this issue
Dec 8, 2016
|
|
jonkerz |
0e41437
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jonkerz commentedDec 7, 2016
I'm not sure what to do here, but this will be linked from two upcoming database scripts.
Two or more taxa can have the same
Taxon#name_cachebecause:Nameobject (we may want to not allow this).Taxon#name_cachehas not been updated (it should be).Background
Taxon#name_id, which points to aNameobject.Nameobjects have aName#name, which is the plain-text version of the full name.Taxon#name_cache, which is a cached copy the plain-text version.Why this matters
Code that looks up taxa by
Taxon#name_cachepicks the first name it finds. In most cases it's not possible to tell that this has happened, so in this sense it doesn't matter. In many other situations it simply works anyways, because the code picks the taxon with the lowest ID, which usually happens to be the correct taxon.Example: if you add Camponotus atra as a synonyms to a species, the code will pick http://antcat.org/catalog/432028 and not http://antcat.org/catalog/432029, because the former has a lower ID.
Where this is an issue:
Species#become_subspecies_of(convert to subspecies button)Subspecies#elevate_to_species(elevate to species button)TaxonDecorator::Headline#headline_type_name(displays the type name in the catalog)SynonymsController#create(for the synonyms section in the 'edit taxon' form)NameFieldsControllerandNamePopupsController.The problem with reusing
Nameobjects is that this means that changes to the name of one of the taxa changes it for all other at the same time.