Skip to content

Commit

Permalink
Remove rescue
Browse files Browse the repository at this point in the history
  • Loading branch information
hunchr committed Aug 22, 2024
1 parent 386cc98 commit ccd949e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app/domain/people/data_quality_checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,10 @@ def self.birthday_less_than_6_years_before_entry(person)
private

def create_or_destroy(issue, invalid)
return @person.data_quality_issues.find_by(issue)&.destroy! unless invalid
existing_issue = @person.data_quality_issues.find_by(issue)

begin
@person.data_quality_issues.create!(issue)
rescue
nil
end
return existing_issue&.destroy! unless invalid

@person.data_quality_issues.create!(issue) if existing_issue.nil?
end
end

0 comments on commit ccd949e

Please sign in to comment.