Permalink
Browse files

Correct and clarify Array#to_sentence docs. Closes #5458.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4485 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent b91e6aa commit b533431ce5ec76ac531a4b303aea3afd35a4dde9 @jeremy jeremy committed Jun 22, 2006
Showing with 4 additions and 2 deletions.
  1. +2 −0 activesupport/CHANGELOG
  2. +2 −2 activesupport/lib/active_support/core_ext/array/conversions.rb
View
2 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
View
4 activesupport/lib/active_support/core_ext/array/conversions.rb
@@ -3,8 +3,8 @@ module CoreExtensions #: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

0 comments on commit b533431

Please sign in to comment.