unepwcmc/SAPI — pull request #88 by simaob (2013-10-15 19:07:43+00:00)
Title: Secondary validation term unit

This commit adds:
* database structure to hold the acceptable pairing between terms and units/purposes
* rake tasks to import the acceptable pairs
* secondary validations for both term and unit pairing, as well as term and purpose pairing

To run these commit you need to:

in shell console:
rake db:migrate

in rails console:
Trade::InclusionValidationRule.create(
:column_names => ['term_code', 'unit_code'],
:valid_values_view => 'valid_term_unit_view',
:run_order => 4
)
Trade::InclusionValidationRule.create(
:column_names => ['term_code', 'purpose_code'],
:valid_values_view => 'valid_term_purpose_view',
:run_order => 4
)