Skip to content

Conversation

@dduugg
Copy link
Contributor

@dduugg dduugg commented Dec 15, 2025

Implements CodeTeams.find!, which is like CodeTeams.find, except that if the team is not found, a CodeTeams:: TeamNotFoundError exception is raised.

The bang version of a method raising exceptions is a common convention in Ruby, and Rails in particular. This is specifically inspired by ActiveRecord, see https://github.com/rails/rails/blob/7ec52e52001bac43688008a9e47de82422582eff/activerecord/lib/active_record/relation/finder_methods.rb#L103-L136

I've added tests for both .find (there seemed to be none) and find!. I've also lightly refactored CodeTeams.all and CodeTeams.find to use more idiomatic Sorbet/Ruby implementations. Happy to split those into a separate PR at the reviewer's request or abandon the refactor entirely.

Copy link
Contributor

@martinemde martinemde left a comment

Choose a reason for hiding this comment

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

looks great and I appreciate the cleanup.

@martinemde martinemde merged commit ef0abe4 into rubyatscale:main Dec 15, 2025
6 checks passed
@github-project-automation github-project-automation bot moved this from Triage to Done in Modularity Dec 15, 2025
@dduugg dduugg deleted the rr-583 branch December 16, 2025 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants