mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #15621 from sgrif/sg-column-type-decorations
No need to decorate columns twice
This commit is contained in:
commit
80b4fe2c50
2 changed files with 1 additions and 2 deletions
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue