aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/result.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-10-08 10:49:46 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-10-08 10:49:53 -0700
commit40898c8c19fa04442fc5f8fb5daf3a8bdb9a1e03 (patch)
tree975f29743ffee4078ae687c2838d9c13929aecb5 /activerecord/lib/active_record/result.rb
parent4cf2f9d57046603c80f8f47a7d17cc6447acd3e4 (diff)
downloadrails-40898c8c19fa04442fc5f8fb5daf3a8bdb9a1e03.tar.gz
rails-40898c8c19fa04442fc5f8fb5daf3a8bdb9a1e03.tar.bz2
rails-40898c8c19fa04442fc5f8fb5daf3a8bdb9a1e03.zip
typecast records returned from the db rather than to_sing everything
Diffstat (limited to 'activerecord/lib/active_record/result.rb')
-rw-r--r--activerecord/lib/active_record/result.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/result.rb b/activerecord/lib/active_record/result.rb
index d0f1cb5b75..1dc3bf3f12 100644
--- a/activerecord/lib/active_record/result.rb
+++ b/activerecord/lib/active_record/result.rb
@@ -46,6 +46,10 @@ module ActiveRecord
IDENTITY_TYPE
end
+ def column_type(name)
+ @column_types[name] || identity_type
+ end
+
def each
if block_given?
hash_rows.each { |row| yield row }