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:
parent
f6aeb8b1a3
commit
b74eed58b2
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue