diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-07-01 18:06:25 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-07-01 18:06:25 -0700 |
commit | 1f75319a9af595d5de3dca55e26547c7f1b166fa (patch) | |
tree | cb587a5444063a885555652f14f7071a9fa7ddbb /activerecord | |
parent | 6cd8e3f58ed2d28d07e341793b9e9c00421540a5 (diff) | |
download | rails-1f75319a9af595d5de3dca55e26547c7f1b166fa.tar.gz rails-1f75319a9af595d5de3dca55e26547c7f1b166fa.tar.bz2 rails-1f75319a9af595d5de3dca55e26547c7f1b166fa.zip |
avoid intermediate zipped array
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/relation/calculations.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/relation/calculations.rb b/activerecord/lib/active_record/relation/calculations.rb index fe1480d8c2..477da618df 100644 --- a/activerecord/lib/active_record/relation/calculations.rb +++ b/activerecord/lib/active_record/relation/calculations.rb @@ -161,9 +161,8 @@ module ActiveRecord result = result.map do |attributes| values = klass.initialize_attributes(attributes).values - columns.zip(values).map do |column, value| - column.type_cast(value) - end + iter = columns.each + values.map { |value| iter.next.type_cast value } end columns.one? ? result.map!(&:first) : result end |