From 192d29f1c7ea16c506c09da2b854d1acdfbc8749 Mon Sep 17 00:00:00 2001 From: Ronak Jangir Date: Sat, 19 Sep 2015 19:15:23 +0530 Subject: Added Examples in docs for internal behavior of Array#to_formatted_s [ci skip] --- activesupport/lib/active_support/core_ext/array/conversions.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/core_ext/array/conversions.rb b/activesupport/lib/active_support/core_ext/array/conversions.rb index c5cc31abc5..8718b7e1e5 100644 --- a/activesupport/lib/active_support/core_ext/array/conversions.rb +++ b/activesupport/lib/active_support/core_ext/array/conversions.rb @@ -85,7 +85,9 @@ class Array # Extends Array#to_s to convert a collection of elements into a # comma separated id list if :db argument is given as the format. # - # Blog.all.to_formatted_s(:db) # => "1,2,3" + # Blog.all.to_formatted_s(:db) # => "1,2,3" + # Blog.none.to_formatted_s(:db) # => "null" + # [1,2].to_formatted_s # => "[1, 2]" def to_formatted_s(format = :default) case format when :db -- cgit v1.2.3