Skip to content

fix(audits): render destroyed-appointment audits when records are gone - #1143

Open
raulriera wants to merge 1 commit into
masterfrom
fix/audits-deleted-doctor
Open

fix(audits): render destroyed-appointment audits when records are gone#1143
raulriera wants to merge 1 commit into
masterfrom
fix/audits-deleted-doctor

Conversation

@raulriera

Copy link
Copy Markdown
Member

Summary

  • audits#show called .fullname on unscoped Doctor/Patient lookups, so the audit page for a destroyed appointment whose doctor or patient was later deleted crashed with NoMethodError
  • Falls back to the existing audits.deleted_item_with_id label (already translated in all three locales); the dead begin/end scaffold around the lookup is removed
  • The parse-error branch no longer ships "Debug: Data present" nor the raw exception message to users — it shows only the translated error notice

Test plan

  • Red tests: NoMethodError on deleted doctor; Debug text in response body
  • Green after fix
  • Full suite passes (525 runs, 0 failures)

audits#show called .fullname on Doctor/Patient lookups without nil
checks, so viewing the audit of a destroyed appointment whose doctor or
patient was later deleted raised NoMethodError. Fall back to the
existing audits.deleted_item_with_id label. Also stop rendering the
'Debug: Data present' line and raw exception message to users when
change data cannot be parsed.
@github-actions github-actions Bot added the fix A bug has been resolved label Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix A bug has been resolved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant