提交 55c05276 编写于 作者: F Francesco Rodriguez

add CollectionProxy#uniq documentation

上级 29713d7f
......@@ -636,6 +636,27 @@ class CollectionProxy < Relation
#
# Pet.find(4, 5, 6) # => ActiveRecord::RecordNotFound: Couldn't find all Pets with IDs (4, 5, 6)
##
# :method: uniq
#
# :call-seq:
# uniq()
#
# Specifies whether the records should be unique or not.
#
# class Person < ActiveRecord::Base
# has_many :pets
# end
#
# person.pets.select(:name)
# # => [
# # #<Pet name: "Fancy-Fancy">,
# # #<Pet name: "Fancy-Fancy">
# # ]
#
# person.pets.select(:name).uniq
# # => [#<Pet name: "Fancy-Fancy">]
##
# :method: count
#
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册