diff options
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/mysql_adapter.rb | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb index 76d5611cd2..04dbcff95c 100644 --- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb @@ -17,17 +17,12 @@ class Mysql class Time ### # This monkey patch is for test_additional_columns_from_join_table - def to_date Date.new(year, month, day) end end -end - -class Mysql - class Stmt - include Enumerable - end + class Stmt; include Enumerable end + class Result; include Enumerable end end module ActiveRecord @@ -357,10 +352,9 @@ module ActiveRecord log(sql, name) do result = @connection.query(sql) cols = result.fetch_fields.map { |field| field.name } - values = [] - result.each { |row| values << row } + rows = result.to_a result.free - ActiveRecord::Result.new(cols, values) + ActiveRecord::Result.new(cols, rows) end end |