instance method
load
Ruby on Rails 4.0.13
Since v4.0.13Signature
load()
Causes the records to be loaded from the database if they have not been loaded already. You can use this if for some reason you need to explicitly load some records before actually using them. The return value is the relation itself, not the records.
Post.where(published: true).load # => #<ActiveRecord::Relation>
Source
# File activerecord/lib/active_record/relation.rb, line 469
def load
exec_queries unless loaded?
self
end
Defined in activerecord/lib/active_record/relation.rb line 469
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Relation