From d64732ec7ca3b477e167bef7fd4651fefe9d6999 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Sun, 28 Aug 2016 15:15:46 +0900 Subject: Switch back to `Hash.dup` Follow up to #26301. --- activerecord/lib/active_record/table_metadata.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'activerecord/lib/active_record/table_metadata.rb') 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) -- cgit v1.2.3