Conversation
modified: app/models/freereg1_csv_entry.rb This commit addresses the issue where CSV entries were not being processed correctly due to a missing validation step. The fix includes adding a validation to ensure that all required fields are present before processing the entry.
- Use record_year from year, baptism_date, burial_date, birth_date, death_date, or confirmation_date - Prevents embargo errors when primary year is not available - Passes the resolved record_year to EmbargoRecord.process_embargo_year
…into BugID-1447
| return [false, ''] if rule.blank? #no rule for this record type | ||
|
|
||
| end_year = EmbargoRecord.process_embargo_year(rule, year) | ||
| record_year = |
There was a problem hiding this comment.
If I understand correctly, the logic here effectively prioritises baptism over birth and burial over death, but does so without first seeing whether either field is blank (the check for blank comes afterwards). But this means that if baptism and birth dates exist in the file, but for the current record only the birth date is populated, then we will return false because year = baptism_date&.year in that case. I think we may want the embargo to apply to the record if any of the date fields fall under the embargo period, but we'd better check with Denise and the trustees about that. The embargo system is supposed to be flexible enough that it can handle whatever constraints are imposed on us by the archives.
modified: app/models/freereg1_csv_entry.rb
This commit addresses the issue where CSV entries were not being processed correctly
due to a missing validation step. The fix includes adding a validation
to ensure that all required fields are present before processing the entry.