Skip to content

BugID-1447#2822

Open
Gev1990123 wants to merge 9 commits intoFreeUKGen:masterfrom
Gev1990123:BugID-1447
Open

BugID-1447#2822
Gev1990123 wants to merge 9 commits intoFreeUKGen:masterfrom
Gev1990123:BugID-1447

Conversation

@Gev1990123
Copy link
Collaborator

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.

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
return [false, ''] if rule.blank? #no rule for this record type

end_year = EmbargoRecord.process_embargo_year(rule, year)
record_year =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants