unepwcmc/SAPI — pull request #94 by simaob (2013-10-22 14:42:42+00:00)
Title: Species source code validation

This branch adds secondary validations for species name and source values on the sandbox tables.
It has pre-defined invalid pairings between Animalia and Plantae with specific Sources.
The validation joins the sandbox table with the taxon concepts table on the full name of the taxon concept and the species_name of the sandbox and then looks into the data store of the taxon concept for the kingdom_name.

To test this you will need to add the following on the Rails console:

Trade::TaxonConceptSourceValidationRule.create(
:column_names => ['species_name', 'source_code'],
:run_order => 4,
:is_primary => false
)