aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activesupport/CHANGELOG2
-rw-r--r--activesupport/lib/active_support/core_ext/array/conversions.rb4
2 files changed, 4 insertions, 2 deletions
diff --git a/activesupport/CHANGELOG b/activesupport/CHANGELOG
index 066b8b7d28..092c42ed3f 100644
--- a/activesupport/CHANGELOG
+++ b/activesupport/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Correct and clarify Array#to_sentence docs. #5458 [brad@madriska.com]
+
* alias_method_chain preserves method punctuation so foo, foo?, and foo! may be chained with the same feature. [Jeremy Kemper]
Example:
alias_method_chain :save!, :validation
diff --git a/activesupport/lib/active_support/core_ext/array/conversions.rb b/activesupport/lib/active_support/core_ext/array/conversions.rb
index 2b42a55ab1..1a5ddee9c6 100644
--- a/activesupport/lib/active_support/core_ext/array/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/array/conversions.rb
@@ -3,8 +3,8 @@ module ActiveSupport #:nodoc:
module Array #:nodoc:
module Conversions
# Converts the array to comma-seperated sentence where the last element is joined by the connector word. Options:
- # * <tt>:connector</tt>: The word used to join the last element in arrays with more than two elements (default: "and")
- # * <tt>:skip_last_comma</tt>: Set to true to return "a, b, and c" instead of "a, b and c".
+ # * <tt>:connector</tt>: The word used to join the last element in arrays with two or more elements (default: "and")
+ # * <tt>:skip_last_comma</tt>: Set to true to return "a, b and c" instead of "a, b, and c".
def to_sentence(options = {})
options.assert_valid_keys(:connector, :skip_last_comma)
options.reverse_merge! :connector => 'and', :skip_last_comma => false