aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/array/prepend_and_append.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-12-21 00:04:55 +0900
committerGitHub <noreply@github.com>2018-12-21 00:04:55 +0900
commit9c87474d82165277a6a5ed3e04b6b88402968134 (patch)
treeb81f4d3fdf5cbcfad38e3763a2bde19ed5655269 /activesupport/lib/active_support/core_ext/array/prepend_and_append.rb
parent3e50a1bcd4b5f3ce26ec94ba061d039c0a6f8062 (diff)
parentd5197d59a112581e8838f6867c0a02806bace46a (diff)
downloadrails-9c87474d82165277a6a5ed3e04b6b88402968134.tar.gz
rails-9c87474d82165277a6a5ed3e04b6b88402968134.tar.bz2
rails-9c87474d82165277a6a5ed3e04b6b88402968134.zip
Merge pull request #34761 from kamipo/require-ruby-2.5
Use native `Array#append`, `Array#prepend`, `Hash#transform_keys`, and `Hash#transform_keys!`
Diffstat (limited to 'activesupport/lib/active_support/core_ext/array/prepend_and_append.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/array/prepend_and_append.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/activesupport/lib/active_support/core_ext/array/prepend_and_append.rb b/activesupport/lib/active_support/core_ext/array/prepend_and_append.rb
index 661971d7cd..ba3739f640 100644
--- a/activesupport/lib/active_support/core_ext/array/prepend_and_append.rb
+++ b/activesupport/lib/active_support/core_ext/array/prepend_and_append.rb
@@ -1,9 +1,5 @@
# frozen_string_literal: true
-class Array
- # The human way of thinking about adding stuff to the end of a list is with append.
- alias_method :append, :push unless [].respond_to?(:append)
+require "active_support/deprecation"
- # The human way of thinking about adding stuff to the beginning of a list is with prepend.
- alias_method :prepend, :unshift unless [].respond_to?(:prepend)
-end
+ActiveSupport::Deprecation.warn "Ruby 2.5+ (required by Rails 6) provides Array#append and Array#prepend natively, so requiring active_support/core_ext/array/prepend_and_append is no longer necessary. Requiring it will raise LoadError in Rails 6.1."