From b533431ce5ec76ac531a4b303aea3afd35a4dde9 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Thu, 22 Jun 2006 17:47:45 +0000 Subject: 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 --- activesupport/CHANGELOG | 2 ++ activesupport/lib/active_support/core_ext/array/conversions.rb | 4 ++-- 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: - # * :connector: The word used to join the last element in arrays with more than two elements (default: "and") - # * :skip_last_comma: Set to true to return "a, b, and c" instead of "a, b and c". + # * :connector: The word used to join the last element in arrays with two or more elements (default: "and") + # * :skip_last_comma: 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 -- cgit v1.2.3