Navigation Menu

Skip to content

Commit

Permalink
remove incorrect example of CollectionAssociation#empty?
Browse files Browse the repository at this point in the history
  • Loading branch information
Francesco Rodriguez committed May 18, 2012
1 parent bf55f28 commit 48acd29
Showing 1 changed file with 0 additions and 17 deletions.
Expand Up @@ -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
Expand Down

0 comments on commit 48acd29

Please sign in to comment.