aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/table_metadata.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2016-08-28 15:15:46 +0900
committerRyuta Kamizono <kamipo@gmail.com>2016-08-28 15:15:46 +0900
commitd64732ec7ca3b477e167bef7fd4651fefe9d6999 (patch)
tree7c99051d805b8b4c7444c124b75fe6ce30667e0f /activerecord/lib/active_record/table_metadata.rb
parentcec60d39891650c96f008aadcb49c249626da3f5 (diff)
downloadrails-d64732ec7ca3b477e167bef7fd4651fefe9d6999.tar.gz
rails-d64732ec7ca3b477e167bef7fd4651fefe9d6999.tar.bz2
rails-d64732ec7ca3b477e167bef7fd4651fefe9d6999.zip
Switch back to `Hash.dup`
Follow up to #26301.
Diffstat (limited to 'activerecord/lib/active_record/table_metadata.rb')
-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)