aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/querying.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2014-06-10 14:50:36 -0600
committerSean Griffin <sean@thoughtbot.com>2014-06-10 14:52:14 -0600
commitda3b4b61732ca4717c99e680ebaf2af43e67ca74 (patch)
tree2b9e8f452f4cecb2764f78f32f4e5b7139c0a8f1 /activerecord/lib/active_record/querying.rb
parent4d209b5daf0eba4c8d008e9d009d0576e04f40d1 (diff)
downloadrails-da3b4b61732ca4717c99e680ebaf2af43e67ca74.tar.gz
rails-da3b4b61732ca4717c99e680ebaf2af43e67ca74.tar.bz2
rails-da3b4b61732ca4717c99e680ebaf2af43e67ca74.zip
No need to decorate columns twice
We never want result types to override column types, and `decorate_columns` can only affect column types. No need to go through the decoration multiple times, we can just exclude the column types from the result types instead.
Diffstat (limited to 'activerecord/lib/active_record/querying.rb')
-rw-r--r--activerecord/lib/active_record/querying.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/querying.rb b/activerecord/lib/active_record/querying.rb
index 1fe54cea3f..39817703cd 100644
--- a/activerecord/lib/active_record/querying.rb
+++ b/activerecord/lib/active_record/querying.rb
@@ -40,7 +40,7 @@ module ActiveRecord
column_types = {}
if result_set.respond_to? :column_types
- column_types = result_set.column_types.merge(columns_hash)
+ column_types = result_set.column_types.except(*columns_hash.keys)
else
ActiveSupport::Deprecation.warn "the object returned from `select_all` must respond to `column_types`"
end