Skip to content

Conversation

@jp524
Copy link
Contributor

@jp524 jp524 commented Feb 16, 2025

Resolves #4989

Description

When trying to delete a BarcodeItem, there was also an attempt to delete the associated Item.
I removed the dependent: :destroy option on the belongs_to association to fix this. Per Rails documentation for the :dependent option, this option shouldn't be used anyway if there is a corresponding has_many association.

I also ensured that flash messages are being displayed if the BarcodeItem is deleted or if it fails to delete.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Added some model tests for BarcodeItem. Modified existing admin system spec for BarcodeItem to be more precise on the expectation.

Screenshots

Screen.Recording.2025-02-16.at.11.13.13.mov

Copy link
Collaborator

@cielf cielf left a comment

Choose a reason for hiding this comment

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

Works well! Over to @dorner for technical comments.

@cielf cielf requested a review from dorner February 18, 2025 19:20
Copy link
Collaborator

@dorner dorner left a comment

Choose a reason for hiding this comment

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

Looks good!

@dorner dorner merged commit b69fe77 into rubyforgood:main Feb 20, 2025
11 checks passed
@jp524 jp524 deleted the 4989-fix-delete-barcode branch February 20, 2025 15:11
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2025

@jp524: Your PR Deleting BarcodeItem works as intended is part of today's Human Essentials production release: 2025.03.02.
Thank you very much for your contribution!

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.

[BUG] delete bar code doesn't work?!

3 participants