diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2016-08-28 09:02:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-28 09:02:29 +0200 |
commit | 9aa6a75eef4f6b4c6f840ec626d31f308e7feba6 (patch) | |
tree | 4a33335cd75a2b472d078e3b7a85b84aacceb3c8 | |
parent | 7a65dc6fe3c54058d92058c14021d017bd279fc6 (diff) | |
parent | d64732ec7ca3b477e167bef7fd4651fefe9d6999 (diff) | |
download | rails-9aa6a75eef4f6b4c6f840ec626d31f308e7feba6.tar.gz rails-9aa6a75eef4f6b4c6f840ec626d31f308e7feba6.tar.bz2 rails-9aa6a75eef4f6b4c6f840ec626d31f308e7feba6.zip |
Merge pull request #26305 from kamipo/follow-up-to-26301
Switch back to `Hash.dup`
-rw-r--r-- | activerecord/lib/active_record/table_metadata.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/table_metadata.rb b/activerecord/lib/active_record/table_metadata.rb index 0ca880e635..a2cb3ea1be 100644 --- a/activerecord/lib/active_record/table_metadata.rb +++ b/activerecord/lib/active_record/table_metadata.rb @@ -10,9 +10,7 @@ module ActiveRecord end def resolve_column_aliases(hash) - # This method is a hot spot, so for now, use Hash[] to dup the hash. - # https://bugs.ruby-lang.org/issues/7166 - new_hash = Hash[hash] + new_hash = hash.dup hash.each do |key, _| if (key.is_a?(Symbol)) && klass.attribute_alias?(key) new_hash[klass.attribute_alias(key)] = new_hash.delete(key) |