Skip to content

Conversation

@akabiru
Copy link
Member

@akabiru akabiru commented Oct 31, 2025

https://community.openproject.org/work_packages/68711

If there is a type called "Other" (or a translation in their team's language) AND there are no documents stored on the instance having that type then remove that type.

@akabiru akabiru added this to the 17.0.x milestone Oct 31, 2025
@akabiru akabiru self-assigned this Oct 31, 2025
@akabiru akabiru requested review from a team and Copilot October 31, 2025 07:49
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a database migration to clean up orphaned "Other" document types and includes comprehensive test coverage. The migration removes document types named "Other" (or its localized equivalent) that have no associated documents, preventing database clutter from unused seeded data.

Key Changes

  • Added a database migration CleanupOtherDocumentType that conditionally deletes orphaned "Other" document types
  • Implemented localization support to handle the "Other" type across different languages (e.g., "Andere" in German)
  • Created thorough RSpec tests covering multiple scenarios including English and localized types, mixed scenarios, and edge cases

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
modules/documents/db/migrate/20251031071403_cleanup_other_document_type.rb Migration that safely removes orphaned "Other" document types with localization support
modules/documents/spec/migrations/cleanup_other_document_type_spec.rb Comprehensive test suite covering various scenarios for the cleanup migration

@akabiru akabiru force-pushed the implementation/68711-cleanup-other-document-type-category-when-not-linked-to-any-documents branch from 9e8c8f8 to cb087bf Compare October 31, 2025 08:54
@akabiru akabiru force-pushed the implementation/68711-cleanup-other-document-type-category-when-not-linked-to-any-documents branch from cb087bf to 56ad5c8 Compare October 31, 2025 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants