Skip to content

Commit 80b4fe2

Browse files
committed
Merge pull request rails#15621 from sgrif/sg-column-type-decorations
No need to decorate columns twice
2 parents 57dba02 + da3b4b6 commit 80b4fe2

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

activerecord/lib/active_record/persistence.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def create(attributes = nil, &block)
4848
# how this "single-table" inheritance mapping is implemented.
4949
def instantiate(attributes, column_types = {})
5050
klass = discriminate_class_for_record(attributes)
51-
column_types = klass.decorate_columns(column_types.dup)
5251
klass.allocate.init_with(
5352
'raw_attributes' => attributes,
5453
'column_types' => column_types,

activerecord/lib/active_record/querying.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def find_by_sql(sql, binds = [])
4040
column_types = {}
4141

4242
if result_set.respond_to? :column_types
43-
column_types = result_set.column_types.merge(columns_hash)
43+
column_types = result_set.column_types.except(*columns_hash.keys)
4444
else
4545
ActiveSupport::Deprecation.warn "the object returned from `select_all` must respond to `column_types`"
4646
end

0 commit comments

Comments
 (0)