aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-06-10 19:14:37 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-06-10 19:14:37 -0300
commit80b4fe2c50feb295af64e1a8c960cfed4fd8ae19 (patch)
tree7ba3aa49f4a39d410e641f30bf27458ea3425e29 /activerecord
parent57dba02817eb28550604853ce0f6a454b6be1780 (diff)
parentda3b4b61732ca4717c99e680ebaf2af43e67ca74 (diff)
downloadrails-80b4fe2c50feb295af64e1a8c960cfed4fd8ae19.tar.gz
rails-80b4fe2c50feb295af64e1a8c960cfed4fd8ae19.tar.bz2
rails-80b4fe2c50feb295af64e1a8c960cfed4fd8ae19.zip
Merge pull request #15621 from sgrif/sg-column-type-decorations
No need to decorate columns twice
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/persistence.rb1
-rw-r--r--activerecord/lib/active_record/querying.rb2
2 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb
index 525289c270..3ab8ec4836 100644
--- a/activerecord/lib/active_record/persistence.rb
+++ b/activerecord/lib/active_record/persistence.rb
@@ -48,7 +48,6 @@ module ActiveRecord
# how this "single-table" inheritance mapping is implemented.
def instantiate(attributes, column_types = {})
klass = discriminate_class_for_record(attributes)
- column_types = klass.decorate_columns(column_types.dup)
klass.allocate.init_with(
'raw_attributes' => attributes,
'column_types' => column_types,
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