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

@ -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