Loading
refactor(rate_limit): rename Matcher.from -> Matcher.build
The factory method on the private Matcher value object was named
.from(input). RuboCop's CodeReuse/ActiveRecord cop (inherited from
gitlab-styles) treats `from` as an ActiveRecord query method and flags
the call site in Rule.new, even though it is plain Hash#transform_values
calling a class method on a non-ActiveRecord object.
Renaming the factory to .build sidesteps the cop without an inline
disable. .build is the more conventional Ruby name for a factory that
normalizes/coerces an input into an instance, and it has no false
collision with ActiveRecord's query API.
No behaviour change; pure rename of an `@api private` method only
called from Rule.new and the spec suite.
Co-Authored-By:
Claude Opus 4.7 (1M context) <noreply@anthropic.com>