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:)