Permalink
Browse files

hashes are ordered, so we do not need to sort

  • Loading branch information...
1 parent 18a74f9 commit 1a193bdc632f99cae09b1657a74a5bc80c946ad6 @tenderlove tenderlove committed Oct 3, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 activerecord/lib/active_record/associations/join_dependency.rb
@@ -147,9 +147,9 @@ def build(associations, parent, join_type)
build(association, parent, join_type)
end
when Hash
- 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)
+ associations.each do |left, right|
+ join_association = build(left, parent, join_type)
+ build(right, join_association, join_type)
end
else
raise ConfigurationError, associations.inspect

0 comments on commit 1a193bd

Please sign in to comment.