Skip to content

4977 add ability to delete unused item categories#5197

Merged
dorner merged 40 commits into
rubyforgood:mainfrom
someykoku:4977_add_ability_to_delete_unused_item_categories
Jul 4, 2025
Merged

4977 add ability to delete unused item categories#5197
dorner merged 40 commits into
rubyforgood:mainfrom
someykoku:4977_add_ability_to_delete_unused_item_categories

Conversation

@someykoku

Copy link
Copy Markdown
Contributor

Resolves #4977 add ability to delete unused item categories

Description

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Documentation update

How Has This Been Tested?

Screenshots

someykoku and others added 23 commits March 7, 2025 17:03
@someykoku someykoku closed this May 12, 2025
@someykoku someykoku reopened this May 12, 2025
@cielf cielf self-requested a review May 12, 2025 23:32
cielf
cielf previously requested changes May 12, 2025

@cielf cielf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for taking a stab at this!
We've got a problem that needs to be addressed, though.

I was playing around with adding and deleting item categories from items, and managed to get to the following situation:

Screenshot 2025-05-12 at 7 31 22 PM

Here we have an item category, with items in it, that nonetheless shows "delete".

It looks like if I create a new item category, then assign an item (these had had an item category already) to it, it is still showing delete.

It shouldn't.

Hope that helps!

@someykoku

Copy link
Copy Markdown
Contributor Author

I'll take a look, thank you.

@someykoku someykoku closed this May 20, 2025
@someykoku someykoku reopened this May 20, 2025
Comment thread spec/models/item_category_spec.rb Outdated
end
end

describe "ItemCategories", type: :request do

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can this be moved under spec/requests please?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, sure. It's done!

@someykoku someykoku closed this May 30, 2025
@someykoku someykoku reopened this May 30, 2025
@someykoku someykoku closed this May 30, 2025
@someykoku someykoku reopened this May 30, 2025
@someykoku someykoku closed this May 30, 2025
@someykoku someykoku reopened this May 30, 2025
@someykoku someykoku closed this May 30, 2025
@someykoku someykoku reopened this May 30, 2025
@someykoku someykoku requested a review from dorner May 30, 2025 13:38

@dorner dorner left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think you moved the wrong spec. :) The one that has type: :request should be in spec/requests.

@someykoku someykoku requested a review from dorner June 1, 2025 09:27
Comment thread spec/models/request_spec.rb Outdated
it { is_expected.to be_versioned }
end

describe "item categories", type: :request do

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This needs to be in spec/requests, not spec/models.

@someykoku someykoku requested a review from dorner June 30, 2025 18:13
let(:partner_group) { create(:partner_group, item_categories: [item_category]) }

before do
partner_group

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Non-blocking: A better way to do this would be to change let(:partner_group) to let!(:partner_group) so you don't need to call it out this way.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you for advice!

@dorner dorner dismissed cielf’s stale review July 4, 2025 19:47

"Looks good functionally"

@dorner dorner merged commit 6b3c5c6 into rubyforgood:main Jul 4, 2025
11 checks passed
@github-actions

github-actions Bot commented Jul 6, 2025

Copy link
Copy Markdown
Contributor

@someykoku: Your PR 4977 add ability to delete unused item categories is part of today's Human Essentials production release: 2025.07.06.
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.

Add ability to delete (unused) item categories

3 participants