mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
use grep over select for consistency and efficiency
pass block directly to grep
This commit is contained in:
parent
50e89373c5
commit
c3ec0dbdd4
1 changed files with 1 additions and 1 deletions
|
@ -1015,7 +1015,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
|
||||
|
|
Loading…
Reference in a new issue