提交 c3ec0dbd 编写于 作者: J John Gesimondo

use grep over select for consistency and efficiency

pass block directly to grep
上级 50e89373
......@@ -1015,7 +1015,7 @@ def build_order(arel)
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册