From 1a193bdc632f99cae09b1657a74a5bc80c946ad6 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 3 Oct 2013 15:28:08 -0700 Subject: hashes are ordered, so we do not need to sort --- activerecord/lib/active_record/associations/join_dependency.rb | 6 +++--- 1 file 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 -- cgit v1.2.3