提交 07b0e599 编写于 作者: A Aaron Patterson

use sort_by

上级 7a237d56
......@@ -151,7 +151,7 @@ def build(associations, parent = nil, join_type = Arel::InnerJoin)
build(association, parent, join_type)
end
when Hash
associations.keys.sort{|a,b|a.to_s<=>b.to_s}.each do |name|
associations.keys.sort_by { |a| a.to_s }.each do |name|
join_association = build(name, parent, join_type)
build(associations[name], join_association, join_type)
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册