aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillermo Iguaran <guilleiguaran@gmail.com>2016-08-27 23:22:14 -0500
committerGitHub <noreply@github.com>2016-08-27 23:22:14 -0500
commitf3f8589f7713fb6c8f5b69989ee09b0429121e76 (patch)
tree966062710ee1addade3b102d49fea71d2080f6ab
parenta63de6db433dffb610509a65aed02991aa718c32 (diff)
parent79a2d07851be86d769a1929d22caea9f46badbb1 (diff)
downloadrails-f3f8589f7713fb6c8f5b69989ee09b0429121e76.tar.gz
rails-f3f8589f7713fb6c8f5b69989ee09b0429121e76.tar.bz2
rails-f3f8589f7713fb6c8f5b69989ee09b0429121e76.zip
Merge pull request #26301 from maclover7/jm-fix-comment
Switch back to `Hash.dup`
-rw-r--r--activerecord/lib/active_record/relation.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb
index 85b1ddf8db..d7de1032b6 100644
--- a/activerecord/lib/active_record/relation.rb
+++ b/activerecord/lib/active_record/relation.rb
@@ -29,9 +29,7 @@ module ActiveRecord
end
def initialize_copy(other)
- # This method is a hot spot, so for now, use Hash[] to dup the hash.
- # https://bugs.ruby-lang.org/issues/7166
- @values = Hash[@values]
+ @values = @values.dup
reset
end
@@ -661,7 +659,7 @@ module ActiveRecord
end
def values
- Hash[@values]
+ @values.dup
end
def inspect