Issue #3561 - Fix for bug "Discrepancy in Org Admin view of the by johnpinto1 · Pull Request #3564 · DMPRoadmap/roadmap
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.
Changes: - Refactored Org model org_admin_plans() method. - Refactored Paginable Plans controller method org_admin().
DRY up FactoryBot traits for roles and plan visibility by consolidating repetitive definitions into iteration loops.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters