aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-04-14 14:26:57 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2011-04-14 14:26:57 -0700
commit9951af02891f889cbc8de818adb6b50ceb31e7bf (patch)
treebd79c2775e6522e0478376dea5298bedb1f274ac
parent199c0bb338568c801792933594d618caf0cdcd4c (diff)
downloadrails-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.rb2
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