1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

get rid of intermediate arrays.

origin: f6aeb8b1a3 (commitcomment-5569649)
This commit is contained in:
Yves Senn 2014-03-05 10:45:37 +01:00
parent f6aeb8b1a3
commit b74eed58b2

View file

@ -1034,8 +1034,9 @@ module ActiveRecord
'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