diff options
author | Ronak Jangir <ronakjangir47@gmail.com> | 2015-09-19 19:15:23 +0530 |
---|---|---|
committer | Ronak Jangir <ronakjangir47@gmail.com> | 2015-09-19 19:16:03 +0530 |
commit | 192d29f1c7ea16c506c09da2b854d1acdfbc8749 (patch) | |
tree | 3e71cfb69721dc0b5f465f551444161c97f1347a /activesupport | |
parent | 2e7415bf71b017180d92ac6fdcafe215cc9eddb6 (diff) | |
download | rails-192d29f1c7ea16c506c09da2b854d1acdfbc8749.tar.gz rails-192d29f1c7ea16c506c09da2b854d1acdfbc8749.tar.bz2 rails-192d29f1c7ea16c506c09da2b854d1acdfbc8749.zip |
Added Examples in docs for internal behavior of Array#to_formatted_s [ci skip]
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/core_ext/array/conversions.rb | 4 |
1 files changed, 3 insertions, 1 deletions
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 <tt>Array#to_s</tt> to convert a collection of elements into a # comma separated id list if <tt>:db</tt> 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 |