Skip to content

Commit c311f48

Browse files
Alexander KoltunAlexander Koltun
Alexander Koltun
authored and
Alexander Koltun
committed
Fix: Change :has_key? to :key? according rubocop
1 parent 6120912 commit c311f48

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/grape/validations/validators/regexp.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module Grape
22
module Validations
33
class RegexpValidator < Base
44
def validate_param!(attr_name, params)
5-
return unless params.respond_to?(:has_key?) && params.has_key?(attr_name)
5+
return unless params.respond_to?(:key?) && params.key?(attr_name)
66
return if Array.wrap(params[attr_name]).all? { |param| param.nil? || (param.to_s =~ (options_key?(:value) ? @option[:value] : @option)) }
77
raise Grape::Exceptions::Validation, params: [@scope.full_name(attr_name)], message: message(:regexp)
88
end

0 commit comments

Comments
 (0)