aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2016-11-14 13:16:00 -0500
committerRafael Mendonça França <rafaelmfranca@gmail.com>2016-11-14 13:16:00 -0500
commit7c1566b2789c779acfeba34a7d86ab5ca5e2c0bd (patch)
tree60e1581f104b36df5dc7398df1fd8fddd5e28d75 /activesupport/lib
parent5f3222155957e887516ffd4be58c4743553415b5 (diff)
downloadrails-7c1566b2789c779acfeba34a7d86ab5ca5e2c0bd.tar.gz
rails-7c1566b2789c779acfeba34a7d86ab5ca5e2c0bd.tar.bz2
rails-7c1566b2789c779acfeba34a7d86ab5ca5e2c0bd.zip
Revert "Merge pull request #25811 from oss92/to_sentence_fallback_string"
This reverts commit bad3a120f1690f393d8f6204b3ceee60f0ce707b, reversing changes made to 2384317465ccb1dfca456a2b7798714b99f32711. Reason: Adding a new option in the API for something that can be done with a `#presence` check could do.
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/core_ext/array/conversions.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/activesupport/lib/active_support/core_ext/array/conversions.rb b/activesupport/lib/active_support/core_ext/array/conversions.rb
index 1d4c83ae52..cac15e1100 100644
--- a/activesupport/lib/active_support/core_ext/array/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/array/conversions.rb
@@ -40,12 +40,6 @@ class Array
# ['one', 'two', 'three'].to_sentence(words_connector: ' or ', last_word_connector: ' or at least ')
# # => "one or two or at least three"
#
- # [].to_sentence(fallback_string: 'none')
- # # => "none"
- #
- # ['one', 'two'].to_sentence(fallback_string: 'none')
- # # => "one and two"
- #
# Using <tt>:locale</tt> option:
#
# # Given this locale dictionary:
@@ -63,7 +57,7 @@ class Array
# ['uno', 'dos', 'tres'].to_sentence(locale: :es)
# # => "uno o dos o al menos tres"
def to_sentence(options = {})
- options.assert_valid_keys(:words_connector, :two_words_connector, :last_word_connector, :locale, :fallback_string)
+ options.assert_valid_keys(:words_connector, :two_words_connector, :last_word_connector, :locale)
default_connectors = {
words_connector: ", ",
@@ -78,7 +72,7 @@ class Array
case length
when 0
- "#{options[:fallback_string] || ''}"
+ ""
when 1
"#{self[0]}"
when 2