Skip to content

Commit dca8481

Browse files
committed
Style fixes
1 parent e44dea4 commit dca8481

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

lib/grape/dsl/parameters.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,7 @@ def params(params)
191191
params = @parent.params(params) if @parent
192192
if @element
193193
params = if params.is_a?(Array)
194-
# we can get nested arrays as result
195-
# it used for calculating parent array indicies for error messages
194+
# used for calculating parent array indices for error messages
196195
params.map { |el| el[@element] || {} }
197196
elsif params.is_a?(Hash)
198197
params[@element] || {}

lib/grape/validations/validators/base.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ def validate(request)
3434
# @raise [Grape::Exceptions::Validation] if validation failed
3535
# @return [void]
3636
def validate!(params)
37-
attributes = AttributesIterator.new(self, @scope, params)
38-
array_errors = []
37+
attributes = AttributesIterator.new(self, @scope, params)
38+
array_errors = []
3939
attributes.each do |resource_params, attr_name, inside_array|
4040
next unless @required || (resource_params.respond_to?(:key?) && resource_params.key?(attr_name))
4141

4242
begin
4343
validate_param!(attr_name, resource_params)
44-
rescue Grape::Exceptions::Validation => error
44+
rescue Grape::Exceptions::Validation => e
4545
raise error unless inside_array
4646
# we collect errors inside array because
4747
# there may be more than one error per field
48-
array_errors << error
48+
array_errors << e
4949
end
5050
end
5151

0 commit comments

Comments
 (0)