Missing ArgumentError for undeclared keyword args #578
scottgratton
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
ActiveInteraction is awesome and has become a fundamental tool for my engineering team - so, first, thanks!
I'd like to propose (unless it already exists and I'm missing it) some kind of option to allow an ActiveInteraction object to raise an
ArgumentError
much like a Rails method given an unexpected keyword argument. In many simple cases, it's probably easy enough to search through usages in the code base and check, but I've seen arguments continue to get passed to a service object after they've been removed from the service, or typos where there just wasn't a test asserting the change expected from the given argument. Knowing that ActiveInteraction would flag these unexpected arguments would be helpful for maintaining services over the course of time.To illustrate the difference, here is an example of a basic Rails method and a basic ActiveInteraction service and the behaviors:
Thanks in advance to any who weigh in on this 🙏
Beta Was this translation helpful? Give feedback.
All reactions