Module: Mongoid::Safe
- Included in:
- Persistence::Atomic::Operation, Persistence::Command
- Defined in:
- lib/mongoid/safe.rb
Overview
Contains behaviour for determining if Mongoid is in safe mode.
Instance Method Summary collapse
-
#safe_mode?(options) ⇒ true, false
Determine based on configuration if we are persisting in safe mode or not.
Instance Method Details
#safe_mode?(options) ⇒ true, false
Determine based on configuration if we are persisting in safe mode or not.
The query option will always override the global configuration.
18 19 20 21 |
# File 'lib/mongoid/safe.rb', line 18 def safe_mode?() safe = [:safe] safe.nil? ? Mongoid.persist_in_safe_mode : safe end |