提交 5111ec44 编写于 作者: F Francesco Rodriguez

add CollectionProxy#include? documentation

上级 ec430d47
......@@ -177,6 +177,19 @@ class CollectionProxy < Relation
# pet.group == 'cats'
# end
# # => true
##
# :method: include?
# Returns true if the given object is present in the collection.
#
# class Person < ActiveRecord::Base
# has_many :pets
# end
#
# person.pets # => [#<Pet id: 20, name: "Snoop">]
#
# person.pets.include?(Pet.find(20)) # => true
# person.pets.include?(Pet.find(21)) # => false
delegate :select, :find, :first, :last,
:build, :create, :create!,
:concat, :replace, :delete_all, :destroy_all, :delete, :destroy, :uniq,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册