mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
CollectionProxy#any? docs: Mention "load.any?"
To go with the change in #41572.
This commit is contained in:
parent
2c83532aec
commit
c0140a7f89
1 changed files with 5 additions and 0 deletions
|
@ -849,6 +849,11 @@ module ActiveRecord
|
|||
# person.pets.count # => 1
|
||||
# person.pets.any? # => true
|
||||
#
|
||||
# Calling it without a block when the collection is not yet
|
||||
# loaded is equivalent to <tt>collection.exists?</tt>.
|
||||
# If you're going to load the collection anyway, it is better
|
||||
# to call <tt>collection.load.any?</tt> to avoid an extra query.
|
||||
#
|
||||
# You can also pass a +block+ to define criteria. The behavior
|
||||
# is the same, it returns true if the collection based on the
|
||||
# criteria is not empty.
|
||||
|
|
Loading…
Reference in a new issue