Sha256: f8dbc7f528426c0ac63819aad16c557e5b921135f8ffb7242030d2615f96efd5

Contents?: true

Size: 501 Bytes

Versions: 2

Compression:

Stored size: 501 Bytes

Contents

# encoding: utf-8
module Mongoid #:nodoc:
  module Commands
    class QuickSave
      # Performs a save of the supplied +Document+ without any validations or
      # callbacks. This is a dangerous command only intended for internal use
      # with saving relational associations.
      #
      # Options:
      #
      # doc: A +Document+ that is going to be persisted.
      #
      # Returns: true
      def self.execute(doc)
        doc.collection.save(doc.attributes)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mongoid-0.9.8 lib/mongoid/commands/quick_save.rb
mongoid-0.9.7 lib/mongoid/commands/quick_save.rb