Issue #3561 - Fix for bug "Discrepancy in Org Admin view of the by johnpinto1 · Pull Request #3564 · DMPRoadmap/roadmap

@johnpinto1 self-assigned this

Sep 25, 2025

aaronskiba

@johnpinto1

    Organisation Plans and the related CSV Download".

    Changes:
    - where(Role.creator_condition) condition added to Plans retrieved in
      the Org model's org_admin_plans method. This ensures that Plans
    returned are only active plans.
    - To avoid duplication we removed .where(Role.creator_condition) in
      org_admin method in app/controllers/paginable/plans_controller.rb from
      line
       plans = plans.joins(:template, roles: [user::org]).where(Role.creator_condition).
    - Updated RSpec tests for Org method org_admin_plans() in spec/models/org_spec.rb.
    - Update CHANGELOG.

aaronskiba

aaronskiba

aaronskiba

aaronskiba

Changes:
  - Refactored Org model org_admin_plans() method.
  - Refactored Paginable Plans controller method org_admin().
coowner being used incorrectly as an Role access_type. A coowner is any
user apart from the plan creator with the Role administrator.

aaronskiba

DRY up FactoryBot traits for roles and plan visibility by consolidating repetitive definitions into iteration loops.
Redesign org_admin_plans tests for clarity and maintainability:

- Introduce helper methods for plan creation and role deactivation.
- Organize plans into native vs affiliated hashes for clearer context.
- Use shared examples to consolidate repetitive expectations.

aaronskiba