Method: ActiveRecord::QueryMethods#preload
- Defined in:
- lib/active_record/relation/query_methods.rb
#preload(*args) ⇒ Object
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)
145 146 147 148 |
# File 'lib/active_record/relation/query_methods.rb', line 145 def preload(*args) check_if_method_has_arguments!("preload", args) spawn.preload!(*args) end |