mirror of https://github.com/rails/rails
Use Hash[] instead of Hash#dup in resolve_column_aliases
Related with #20418
This commit is contained in:
parent
8167d18c71
commit
d1ce45cd8c
|
@ -10,7 +10,9 @@ module ActiveRecord
|
|||
end
|
||||
|
||||
def resolve_column_aliases(hash)
|
||||
hash = hash.dup
|
||||
# This method is a hot spot, so for now, use Hash[] to dup the hash.
|
||||
# https://bugs.ruby-lang.org/issues/7166
|
||||
hash = Hash[hash]
|
||||
hash.keys.grep(Symbol) do |key|
|
||||
if klass.attribute_alias? key
|
||||
hash[klass.attribute_alias(key)] = hash.delete key
|
||||
|
|
Loading…
Reference in New Issue