mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #21678 from ronakjangir47/array_to_formatted_s_docs
Added Examples in docs for internal behavior of Array#to_formatted_s [ci skip]
This commit is contained in:
commit
d1a43d32e6
1 changed files with 3 additions and 1 deletions
|
@ -86,6 +86,8 @@ class Array
|
|||
# comma separated id list if <tt>:db</tt> argument is given as the format.
|
||||
#
|
||||
# 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
|
||||
|
|
Loading…
Reference in a new issue