提交 48acd29a 编写于 作者: F Francesco Rodriguez

remove incorrect example of CollectionAssociation#empty?

上级 bf55f28a
......@@ -313,23 +313,6 @@ def length
# person.pets.delete_all
# person.pets.count # => 0
# person.pets.empty? # => true
#
# Also, you can pass a block to define a criteria. The behaviour
# is the same, it returns true if the collection based on the
# criteria is empty.
#
# person.pets
# # => [#<Pet name: "Wy", group: "cats">]
#
# person.pets.empty? do |pet|
# pet.group == 'cats'
# end
# # => false
#
# person.pets.empty? do |pet|
# pet.group == 'dogs'
# end
# # => true
def empty?
size.zero?
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册