Method: Mongoid#unit_of_work
- Defined in:
- lib/mongoid.rb
#unit_of_work ⇒ Object
We can process a unit of work in Mongoid and have the identity map automatically clear itself out after the work is complete.
130 131 132 133 134 135 136 |
# File 'lib/mongoid.rb', line 130 def unit_of_work begin yield if block_given? ensure IdentityMap.clear end end |