aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2016-08-28 09:02:29 +0200
committerGitHub <noreply@github.com>2016-08-28 09:02:29 +0200
commit9aa6a75eef4f6b4c6f840ec626d31f308e7feba6 (patch)
tree4a33335cd75a2b472d078e3b7a85b84aacceb3c8 /activerecord
parent7a65dc6fe3c54058d92058c14021d017bd279fc6 (diff)
parentd64732ec7ca3b477e167bef7fd4651fefe9d6999 (diff)
downloadrails-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`
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/table_metadata.rb4
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)