Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

remove incorrect example of CollectionAssociation#empty?

  • Loading branch information...
commit 48acd29adbd86cec54eec6760dd317f4901125aa 1 parent bf55f28
Francesco Rodriguez authored
View
17 activerecord/lib/active_record/associations/collection_association.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.