Fix NoMethodError in recipients funder grouping (grant.donor → grant.funder) - #2164
Merged
Conversation
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>
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>
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>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 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_funderstill calledgrant.donor, but Unify grant-funder naming on "Funder" (drop Donor/Grantor) #2147 ("Unify grant-funder naming on Funder") removedGrant#donorin favor of the polymorphicfunder.NoMethodError: undefined method 'donor'at runtime for any event with a grant-funded scholarship. Live onmainnow, with two specs already failing (event_dashboard_spec.rb,events_spec.rb).How did you approach the change?
grant&.donorcalls atgrant&.funder(the polymorphic funder record — Organization or Person) — this is the actual crash fix.FunderGroup's:donormember →:funder,donor_location→funder_location, and the remaining local variables/comments/spec references. Updated the recipients view and specs that read the struct member..funder_namesearch-match spec's"Big Donor Foundation"org and"big donor"query →"Big Funder Foundation"/"big funder".donorstrings 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?