rubyforgood / coral

An upcoming project for Ruby for Good
MIT License
13 stars 11 forks source link

Bug fix: The restoration activity log index broke if there were any log entrie… #76

Closed LizPrescott closed 4 years ago

LizPrescott commented 4 years ago

…s that we not associated with a nursery table. An alternative to this quick fix is to enforce the presence of a nursery table id (it is marked optional: true in the restoration activity log entry model). Would also need to figure out why the nursery table is not being assigned in the create new log form.

Type of change

How Has This Been Tested?

Tested manually in the browser and added specs to confirm that table_name produced the desired output in both major cases.

Screenshots

cflipse commented 4 years ago

The biggest risk of doing a validation on the presence of the table_id is that ... it can still change and get lost (think, a table row gets deleted from the db) or otherwise.

A table_name method in the log might be more robust, and allows for a fallback of "not found" / unknown if it can't make the link, instead of just propagating a nil