Skip to content
Browse files

remove incorrect example of CollectionAssociation#empty?

  • Loading branch information...
1 parent bf55f28 commit 48acd29adbd86cec54eec6760dd317f4901125aa Francesco Rodriguez committed May 18, 2012
Showing with 0 additions and 17 deletions.
  1. +0 −17 activerecord/lib/active_record/associations/collection_association.rb
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

0 comments on commit 48acd29

Please sign in to comment.
Something went wrong with that request. Please try again.