Module: Mongoid::Extras::ClassMethods
- Defined in:
- lib/mongoid/extras.rb
Overview
:nodoc
Instance Method Summary collapse
-
#cache ⇒ Object
Sets caching on for this class.
Instance Method Details
#cache ⇒ Object
Sets caching on for this class. This class level configuration will default all queries to cache the results of the first iteration over the cursor into an internal array. This should only be used for queries that return a small number of results or have small documents, as after the first iteration the entire results will be stored in memory.
26 27 28 |
# File 'lib/mongoid/extras.rb', line 26 def cache self.cached = true end |