instance method
preload
Ruby on Rails 6.1.7.10
Since v3.0.20Signature
preload(*args)
Allows preloading of args, in the same way that #includes does:
User.preload(:posts) # SELECT "posts".* FROM "posts" WHERE "posts"."user_id" IN (1, 2, 3)
Parameters
-
argsrest
Source
# File activerecord/lib/active_record/relation/query_methods.rb, line 180
def preload(*args)
check_if_method_has_arguments!(:preload, args)
spawn.preload!(*args)
end
Defined in activerecord/lib/active_record/relation/query_methods.rb line 180
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::QueryMethods