diff options
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/array/conversions.rb | 10 |
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 |