Merge pull request #46489 from OuYangJinTing/update-association-preload-doc [ci-skip]

Update association preload doc
This commit is contained in:
Petrik de Heus 2022-11-14 17:15:38 +01:00 committed by GitHub
commit ada130c0d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -586,8 +586,10 @@ module ActiveRecord
# has_many :birthday_events, ->(user) { where(starts_on: user.birthday) }, class_name: 'Event'
# end
#
# Note: Joining, eager loading, and preloading of these associations is not possible.
# These operations happen before instance creation and the scope will be called with a +nil+ argument.
# Note: Joining and eager loading of these associations is not possible.
# These two operations happen before instance creation and the scope will be called with a +nil+ argument.
# It is allowed to be preloaded, but in the case that there's a different scope for each record,
# this will perform N+1 queries. (this is essentially the same as preloading polymorphic scopes).
#
# == Association callbacks
#