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

Merge pull request #10767 from jmondo/master

Use grep instead of select with === in QueryMethods
This commit is contained in:
Carlos Antonio da Silva 2013-05-29 05:05:54 -07:00
commit c2f3efffd9

View file

@ -1010,7 +1010,7 @@ module ActiveRecord
end
def validate_order_args(args)
args.select { |a| Hash === a }.each do |h|
args.grep(Hash) do |h|
unless (h.values - [:asc, :desc]).empty?
raise ArgumentError, 'Direction should be :asc or :desc'
end