Sha256: 3bce0a772ce7a574f4be708d39878733e83006ff69ecb8f3734eeb114d7be393
Contents?: true
Size: 630 Bytes
Versions: 13
Compression:
Stored size: 630 Bytes
Contents
# encoding: utf-8 module Mongoid #:nodoc: # Contains behaviour for determining if Mongoid is in safe mode. module Safe # Determine based on configuration if we are persisting in safe mode or # not. # # The query option will always override the global configuration. # # @example Are we in safe mode? # document.safe_mode?(:safe => true) # # @param [ Hash ] options Persistence options. # # @return [ true, false ] True if in safe mode, false if not. def safe_mode?(options) safe = options[:safe] safe.nil? ? Mongoid.persist_in_safe_mode : safe end end end
Version data entries
13 entries across 13 versions & 3 rubygems