diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2016-08-28 15:15:46 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2016-08-28 15:15:46 +0900 |
commit | d64732ec7ca3b477e167bef7fd4651fefe9d6999 (patch) | |
tree | 7c99051d805b8b4c7444c124b75fe6ce30667e0f | |
parent | cec60d39891650c96f008aadcb49c249626da3f5 (diff) | |
download | rails-d64732ec7ca3b477e167bef7fd4651fefe9d6999.tar.gz rails-d64732ec7ca3b477e167bef7fd4651fefe9d6999.tar.bz2 rails-d64732ec7ca3b477e167bef7fd4651fefe9d6999.zip |
Switch back to `Hash.dup`
Follow up to #26301.
-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) |