diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-10-15 11:18:38 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-10-15 11:18:38 -0700 |
commit | dc126cfd6f664f92b5a522bd98fbf39ff474785f (patch) | |
tree | 5537a0a690ba87013481359993e46d186fdc28e8 /activerecord/lib | |
parent | 02174a3efc6fa8f2e5e6f114e4cf0d8a06305b6a (diff) | |
download | rails-dc126cfd6f664f92b5a522bd98fbf39ff474785f.tar.gz rails-dc126cfd6f664f92b5a522bd98fbf39ff474785f.tar.bz2 rails-dc126cfd6f664f92b5a522bd98fbf39ff474785f.zip |
buckets hash isn't public, so use symbol keys to avoid string
allocations
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index a9ace10093..14bcb337e9 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -738,22 +738,22 @@ module ActiveRecord buckets = joins.group_by do |join| case join when String - 'string_join' + :string_join when Hash, Symbol, Array - 'association_join' + :association_join when ActiveRecord::Associations::JoinDependency::JoinAssociation - 'stashed_join' + :stashed_join when Arel::Nodes::Join - 'join_node' + :join_node else raise 'unknown class: %s' % join.class.name end end - association_joins = buckets['association_join'] || [] - stashed_association_joins = buckets['stashed_join'] || [] - join_nodes = (buckets['join_node'] || []).uniq - string_joins = (buckets['string_join'] || []).map { |x| + association_joins = buckets[:association_join] || [] + stashed_association_joins = buckets[:stashed_join] || [] + join_nodes = (buckets[:join_node] || []).uniq + string_joins = (buckets[:string_join] || []).map { |x| x.strip }.uniq |