aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2017-04-15 16:13:05 +0200
committerGitHub <noreply@github.com>2017-04-15 16:13:05 +0200
commit1e0d8425f6526b0082693fe122a36449aa12a69e (patch)
treed1374d9655a8708bc129fb775ef51b0702020586 /activesupport
parentc8a9ac000d72f8435eb1bc417bf8a001ec20cb6a (diff)
parent49a463717e8edbd4e3f299bd7210aa91ddec2510 (diff)
downloadrails-1e0d8425f6526b0082693fe122a36449aa12a69e.tar.gz
rails-1e0d8425f6526b0082693fe122a36449aa12a69e.tar.bz2
rails-1e0d8425f6526b0082693fe122a36449aa12a69e.zip
Merge pull request #28638 from bogdanvlviv/prepend_and_append_in_ruby
Prevent aliases Array#append and Array#prepend
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/array/prepend_and_append.rb4
1 files changed, 2 insertions, 2 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 16a6789f8d..88a34128c9 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,7 +1,7 @@
class Array
# The human way of thinking about adding stuff to the end of a list is with append.
- alias_method :append, :<<
+ alias_method :append, :push unless [].respond_to?(:append)
# The human way of thinking about adding stuff to the beginning of a list is with prepend.
- alias_method :prepend, :unshift
+ alias_method :prepend, :unshift unless [].respond_to?(:prepend)
end