get rid of intermediate arrays.
origin: f6aeb8b1a3 (commitcomment-5569649)
This commit is contained in:
parent
f6aeb8b1a3
commit
b74eed58b2
@ -1034,8 +1034,9 @@ def build_order(arel)
|
||||
'asc', 'desc', 'ASC', 'DESC'] # :nodoc:
|
||||
|
||||
def validate_order_args(args)
|
||||
args.grep(Hash) do |h|
|
||||
h.values.each do |value|
|
||||
args.each do |arg|
|
||||
next unless arg.is_a?(Hash)
|
||||
arg.each do |_key, value|
|
||||
raise ArgumentError, "Direction \"#{value}\" is invalid. Valid " \
|
||||
"directions are: #{VALID_DIRECTIONS.inspect}" unless VALID_DIRECTIONS.include?(value)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user