Sha256: c3f863b5c43a5e61f02263b96d0c4014c4708b03a521043f2c2f17fbf128b3a3

Contents?: true

Size: 311 Bytes

Versions: 7

Compression:

Stored size: 311 Bytes

Contents

module MongoMapper
  module Utils
    def self.get_safe_options(options)
      return {} unless options and options.key? :safe
      safe = options[:safe]
      safe = {:w => 1} if safe == true
      safe = {:w => 0} if safe == false
      safe = {:w => safe} if safe.is_a? Integer
      safe
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mongo_mapper-0.15.6 lib/mongo_mapper/utils.rb
mongo_mapper-0.15.5 lib/mongo_mapper/utils.rb
mongo_mapper-0.15.4 lib/mongo_mapper/utils.rb
mongo_mapper-0.15.3 lib/mongo_mapper/utils.rb
mongo_mapper-0.15.2 lib/mongo_mapper/utils.rb
mongo_mapper-0.15.1 lib/mongo_mapper/utils.rb
mongo_mapper-0.15.0 lib/mongo_mapper/utils.rb