Skip to content

Commit

Permalink
Refactor uses of to_class_name to use suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
apexatoll committed Nov 15, 2023
1 parent 92a6860 commit 067ab04
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/kangaru/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/kangaru/validation/attribute_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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:)
Expand Down

0 comments on commit 067ab04

Please sign in to comment.