Sha256: e87175799cd2041779c49a204000973595da539926ab9cef1a21f487264079a2
Contents?: true
Size: 546 Bytes
Versions: 39
Compression:
Stored size: 546 Bytes
Contents
# encoding: utf-8 module Mongoid #:nodoc: module Commands class Create # Performs a create of the supplied Document, with the necessary # callbacks. It then delegates to the Save command. # # Options: # # doc: A new +Document+ that is going to be persisted. # # Returns: +Document+. def self.execute(doc, validate = true) doc.run_callbacks :before_create Save.execute(doc, validate) doc.run_callbacks :after_create return doc end end end end
Version data entries
39 entries across 39 versions & 1 rubygems