From 067ab04b06f3cf840902575967c7cbe3255500bf Mon Sep 17 00:00:00 2001 From: Chris Welham <71787007+apexatoll@users.noreply.github.com> Date: Wed, 15 Nov 2023 18:26:12 +0000 Subject: [PATCH] Refactor uses of to_class_name to use suffix --- lib/kangaru/request.rb | 2 +- lib/kangaru/validation/attribute_validator.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/kangaru/request.rb b/lib/kangaru/request.rb index 13a12c8..ba52ee1 100644 --- a/lib/kangaru/request.rb +++ b/lib/kangaru/request.rb @@ -18,7 +18,7 @@ def initialize(path:, params:) def controller return default_controller if path_parser.controller.nil? - path_parser.controller&.to_class_name&.concat(Controller::SUFFIX) || raise + path_parser.controller&.to_class_name(suffix: Controller::SUFFIX) || raise end def action diff --git a/lib/kangaru/validation/attribute_validator.rb b/lib/kangaru/validation/attribute_validator.rb index 9bb1e24..4e16cd1 100644 --- a/lib/kangaru/validation/attribute_validator.rb +++ b/lib/kangaru/validation/attribute_validator.rb @@ -17,7 +17,7 @@ def validate(validator, **params) private def validator_name(validator) - "#{validator.to_s.to_class_name}Validator" + validator.to_s.to_class_name(suffix: :validator) end def load_validator(validator:, params:)