diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-03 15:28:08 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-03 15:28:08 -0700 |
commit | 1a193bdc632f99cae09b1657a74a5bc80c946ad6 (patch) | |
tree | 621ba4a6d916cc809bab5bc5828adb86a041e1ab /activerecord/lib | |
parent | 18a74f9bbafd55e30d7590013c1a260f16242385 (diff) | |
download | rails-1a193bdc632f99cae09b1657a74a5bc80c946ad6.tar.gz rails-1a193bdc632f99cae09b1657a74a5bc80c946ad6.tar.bz2 rails-1a193bdc632f99cae09b1657a74a5bc80c946ad6.zip |
hashes are ordered, so we do not need to sort
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb index 117f027fed..8f65c2b5d4 100644 --- a/activerecord/lib/active_record/associations/join_dependency.rb +++ b/activerecord/lib/active_record/associations/join_dependency.rb @@ -147,9 +147,9 @@ module ActiveRecord 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 |