Unhelpful error message for bulk upload
When the trait_covariate_associations table contains references to non-existent trait ids (CORRECTION: variable ids?; this table only refers to the variables table; see UPDATE below), the bulk upload will fail with the message "undefined method `name' for nil:NilClass", which is not very helpful.
The best solution is to ensure this error never occurs by imposing foreign-key constraints.
UPDATE: There already are foreign-key constraints on this table. Not sure what the cause was of the error I was seeing.
Would it be difficult to allow data to be uploaded for traits that don't have an associated covariate? As is, every time I add a new variable, I have to add covariates.
Or would it be easier to implement new pages to create and edit records in this table?
I've been thinking for some time that it should be possible to edit the trait_covariate_associations table via the Web interface. It also would probably not be hard to allow arbitrary variables to be used as trait variables, which would work like this: if a column name corresponds to a variable name and isn't mentioned in the trait_covariate_associations table, it would automatically be considered a trait variable with no associated covariates.
Please start with
if a column name corresponds to a variable name and isn't mentioned in the trait_covariate_associations table, it would automatically be considered a trait variable with no associated covariates.
How hard would it be to add the new and edit pages for trait_covariate_associations?