aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/object/duplicable.rb
diff options
context:
space:
mode:
authorJeremy Daer <jeremydaer@gmail.com>2018-02-17 13:02:18 -0800
committerJeremy Daer <jeremydaer@gmail.com>2018-02-17 15:34:57 -0800
commitd4eb0dc89ee6b476e2e10869dc282a96f956c6c7 (patch)
tree40007170fb8b42d77f93766e0a429b1fbc8db919 /activesupport/lib/active_support/core_ext/object/duplicable.rb
parent33886e28f1c06b7f252c1db0e433794b00c54a2f (diff)
downloadrails-d4eb0dc89ee6b476e2e10869dc282a96f956c6c7.tar.gz
rails-d4eb0dc89ee6b476e2e10869dc282a96f956c6c7.tar.bz2
rails-d4eb0dc89ee6b476e2e10869dc282a96f956c6c7.zip
Rails 6 requires Ruby 2.4.1+
Skipping over 2.4.0 to sidestep the `"symbol_from_string".to_sym.dup` bug. References #32028
Diffstat (limited to 'activesupport/lib/active_support/core_ext/object/duplicable.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/object/duplicable.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/duplicable.rb b/activesupport/lib/active_support/core_ext/object/duplicable.rb
index 9bb99087bc..c78ee6bbfc 100644
--- a/activesupport/lib/active_support/core_ext/object/duplicable.rb
+++ b/activesupport/lib/active_support/core_ext/object/duplicable.rb
@@ -75,8 +75,11 @@ end
class Symbol
begin
- :symbol.dup # Ruby 2.4.x.
- "symbol_from_string".to_sym.dup # Some symbols can't `dup` in Ruby 2.4.0.
+ :symbol.dup
+
+ # Some symbols couldn't be duped in Ruby 2.4.0 only, due to a bug.
+ # This feature check catches any regression.
+ "symbol_from_string".to_sym.dup
rescue TypeError
# Symbols are not duplicable: