Skip to content

Commit 197e017

Browse files
committed
Use Array.wrap
1 parent 079b2aa commit 197e017

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/grape.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
require 'active_support/core_ext/hash/indifferent_access'
1212
require 'active_support/core_ext/object/blank'
1313
require 'active_support/core_ext/array/extract_options'
14+
require 'active_support/core_ext/array/wrap'
1415
require 'active_support/core_ext/hash/deep_merge'
1516
require 'active_support/core_ext/hash/except'
1617
require 'active_support/dependencies/autoload'

lib/grape/validations/attributes_iterator.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ class AttributesIterator
55

66
def initialize(validator, scope, params)
77
@attrs = validator.attrs
8-
@params = scope.params(params)
9-
@params = (@params.is_a?(Array) ? @params : [@params])
8+
@params = Array.wrap(scope.params(params))
109
end
1110

1211
def each

0 commit comments

Comments
 (0)