Skip to content

Fix NoMethodError in recipients funder grouping (grant.donor → grant.funder) - #2164

Merged
maebeale merged 3 commits into
mainfrom
maebeale/fix-grant-donor-funder
Aug 10, 2026
Merged

Fix NoMethodError in recipients funder grouping (grant.donor → grant.funder)#2164
maebeale merged 3 commits into
mainfrom
maebeale/fix-grant-donor-funder

Conversation

@maebeale

@maebeale maebeale commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

🤖 suggested review level: 3 Read 📖 small rename fix for a live crash, plus finishing the donor→funder cleanup it exposed

What is the goal of this PR and why is this important?

  • EventDashboard#scholarship_applicants_by_funder still called grant.donor, but Unify grant-funder naming on "Funder" (drop Donor/Grantor) #2147 ("Unify grant-funder naming on Funder") removed Grant#donor in favor of the polymorphic funder.
  • Result: the recipients page's "group by funder" view raises NoMethodError: undefined method 'donor' at runtime for any event with a grant-funded scholarship. Live on main now, with two specs already failing (event_dashboard_spec.rb, events_spec.rb).

How did you approach the change?

  • Point the two grant&.donor calls at grant&.funder (the polymorphic funder record — Organization or Person) — this is the actual crash fix.
  • Finish Unify grant-funder naming on "Funder" (drop Donor/Grantor) #2147's rename: FunderGroup's :donor member → :funder, donor_locationfunder_location, and the remaining local variables/comments/spec references. Updated the recipients view and specs that read the struct member.
  • Also renamed the last stray donor wording in the funder-naming code path: the .funder_name search-match spec's "Big Donor Foundation" org and "big donor" query → "Big Funder Foundation" / "big funder".
  • Left genuinely-unrelated donor strings alone (the "Fundraising/Donor Engagement" sector label + its migration/color mappings, the "Major Donors" awbw.org nav link, and the historical create/rename migrations that must reference the old column names).

Anything else to add?

PR #2147 unified grant-funder naming on "funder" and dropped Grant#donor, but
EventDashboard#scholarship_applicants_by_funder still called grant.donor — so
the recipients funder grouping raised NoMethodError whenever a funded
scholarship was present, and two specs failed on main. Point those calls (and
the two grant factory usages) at grant.funder.

Unrelated to #1944; bundled here to keep the branch green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 10, 2026 03:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Complete #2147's naming unification in the recipients funder grouping: rename
the FunderGroup :donor member, the funder_location helper, and the local
variables/comments from "donor" to "funder". No behavior change beyond the
struct member name (updated in the view and specs that read it).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 10, 2026 03:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Finish the donor→funder cleanup: the search-match test data used a
"Big Donor Foundation" org and a "big donor" query, the last stray
donor wording in the funder-naming code path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 10, 2026 11:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@maebeale
maebeale marked this pull request as ready for review August 10, 2026 12:00
@maebeale
maebeale merged commit 3bef9f7 into main Aug 10, 2026
3 checks passed
@maebeale
maebeale deleted the maebeale/fix-grant-donor-funder branch August 10, 2026 12:06
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.

2 participants