Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

get rid of intermediate arrays.

  • Loading branch information...
commit b74eed58b228b49c5298cf0df9c6890d0b8a4ab5 1 parent f6aeb8b
@senny senny authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 activerecord/lib/active_record/relation/query_methods.rb
View
5 activerecord/lib/active_record/relation/query_methods.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.