aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/lib/active_record/table_metadata.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/table_metadata.rb b/activerecord/lib/active_record/table_metadata.rb
index 41f1c55c3c..702bf8a885 100644
--- a/activerecord/lib/active_record/table_metadata.rb
+++ b/activerecord/lib/active_record/table_metadata.rb
@@ -10,7 +10,9 @@ module ActiveRecord
end
def resolve_column_aliases(hash)
- hash = hash.dup
+ # This method is a hot spot, so for now, use Hash[] to dup the hash.
+ # https://bugs.ruby-lang.org/issues/7166
+ hash = Hash[hash]
hash.keys.grep(Symbol) do |key|
if klass.attribute_alias? key
hash[klass.attribute_alias(key)] = hash.delete key