You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Updating sponsor results in duplicate sponsor #2500
I created a new sponsor and then made 2 separate updates to the details - that is, I hit "Save changes" after each update. This has resulted in 3 of the same sponsor being created. However, it's worth noting that, while searching for the sponsor from /admin/sponsors returns 3 results, only the sponsor with the ID 1541 actually shows a sponsor page when clicked on. The other 2 results (1539 & 1540) return an HTTP 500 response. So it would seem that only the sponsor created from the last update is valid (assuming the IDs are incremental).
Screenshots 📷
Steps to fix 🛠
To do 📋
Claim this issue (comment below, or assign yourself if you are part of the codebar org)
Fork and clone the repository
Update the relevant files. Follow the steps to fix section in this issue.
Commit your changes as one commit. Use the title of this issue as your commit message
Submit a pull request
Mention this issue in the PR description by including it's number
Have your pull request reviewed & merged by a codebar team member
resulting in undefined method '/' for nil when trying to fallback to seats / 2.0
However, I haven't been able to recreate editing an existing sponsor leading to a duplicate being created. I've messaged @carvingpumpkins on Slack to ask if this is still happening for them.
Activity
mikej commentedon Apr 13, 2026
I've found the exceptions in Rollbar for attempts to view 1539 & 1540.
Looks like this is because these sponsor records don't have a number of students or coach spots and the logic for displaying coach spots does:
resulting in
undefined method '/' for nilwhen trying to fallback toseats / 2.0However, I haven't been able to recreate editing an existing sponsor leading to a duplicate being created. I've messaged @carvingpumpkins on Slack to ask if this is still happening for them.
fix: make sponsor coach spots nil-safe