diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-04-14 14:26:57 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-04-14 14:26:57 -0700 |
commit | 9951af02891f889cbc8de818adb6b50ceb31e7bf (patch) | |
tree | bd79c2775e6522e0478376dea5298bedb1f274ac | |
parent | 199c0bb338568c801792933594d618caf0cdcd4c (diff) | |
download | rails-9951af02891f889cbc8de818adb6b50ceb31e7bf.tar.gz rails-9951af02891f889cbc8de818adb6b50ceb31e7bf.tar.bz2 rails-9951af02891f889cbc8de818adb6b50ceb31e7bf.zip |
sort insert columns for better cache hits
-rw-r--r-- | activerecord/lib/active_record/relation.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index 9fe806425e..359f9d8a66 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -50,7 +50,7 @@ module ActiveRecord conn = @klass.connection - substitutes = values.to_a + substitutes = values.sort_by { |arel_attr,_| arel_attr.name } binds = substitutes.map do |arel_attr, value| [@klass.columns_hash[arel_attr.name], value] end |