Skip to content

WA-DOC-027: Add any_of Mongoid 8 migration pattern doc #1129

Description

@kitcommerce

Summary

WA-VERIFY-091 (PR #1091) found and fixed two real bugs related to any_of semantics changing between Mongoid 7 and Mongoid 8. Document this as a reusable migration pattern for downstream Workarea implementations.

Objective

Create docs/rails7-migration-patterns/mongoid8-any-of-semantics.md to describe the any_of scoping change, detection strategy, and fix pattern — so Workarea plugin authors and downstream apps can apply the same fixes.

Approach

Base the doc on the notes from PR #1091 (notes/WA-VERIFY-091-mongoid8-any-of.md if it exists) and the fix patterns implemented in:

  • admin/app/view_models/workarea/admin/activity_view_model.rb
  • core/app/models/workarea/tax/rate.rb

Acceptance Criteria

  • New file: docs/rails7-migration-patterns/mongoid8-any-of-semantics.md
  • Describes the Mongoid 7 vs 8 any_of API difference (array arg vs splat)
  • Includes detection grep command (rg ".any_of" --glob='*.rb')
  • Documents the fix patterns (splatting, loop-to-collect refactor)
  • Links to PR WA-VERIFY-091: Audit and fix Mongoid 8 any_of scoping semantics #1091 as the reference implementation
  • README index in docs/rails7-migration-patterns/README.md updated to include new doc

Verification Plan

  • Read the doc for clarity and completeness
  • Verify README index updated

Client Impact

None (documentation only).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions