123456789_123456789_123456789_123456789_123456789_

Module: Mongoid::Threaded::Lifecycle::ClassMethods

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Extended In:
Defined in: lib/mongoid/threaded/lifecycle.rb

Instance Method Summary

Instance Method Details

#_creatingObject

Execute a block in creating mode.

Examples:

Execute in creating mode.

creating do
  relation.push(doc)
end

Returns:

  • (Object)

    The return value of the block.

[ GitHub ]

  
# File 'lib/mongoid/threaded/lifecycle.rb', line 141

def _creating
  Threaded.begin_execution(CREATE)
  yield
ensure
  Threaded.exit_execution(CREATE)
end