diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-02-07 11:51:30 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-02-07 13:51:53 -0800 |
commit | 00b62ab73bef05126fdfb72291beee60898c4f8e (patch) | |
tree | ba5f83bc5ce6fdfe8af427b61a424109af045bfe /activerecord/lib/active_record/result.rb | |
parent | ab6ebcceb1052f55ff8a93cf2a80b79f32c50ee9 (diff) | |
download | rails-00b62ab73bef05126fdfb72291beee60898c4f8e.tar.gz rails-00b62ab73bef05126fdfb72291beee60898c4f8e.tar.bz2 rails-00b62ab73bef05126fdfb72291beee60898c4f8e.zip |
moving column types to an ivar on the result
Diffstat (limited to 'activerecord/lib/active_record/result.rb')
-rw-r--r-- | activerecord/lib/active_record/result.rb | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/result.rb b/activerecord/lib/active_record/result.rb index 4eb2cf3a72..fb4b89b87b 100644 --- a/activerecord/lib/active_record/result.rb +++ b/activerecord/lib/active_record/result.rb @@ -8,12 +8,13 @@ module ActiveRecord class Result include Enumerable - attr_reader :columns, :rows + attr_reader :columns, :rows, :column_types def initialize(columns, rows) - @columns = columns - @rows = rows - @hash_rows = nil + @columns = columns + @rows = rows + @hash_rows = nil + @column_types = {} end def each @@ -49,10 +50,6 @@ module ActiveRecord @hash_rows = nil end - def column_types - {} - end - private def hash_rows @hash_rows ||= @rows.map { |row| |