Sha256: 0ab3213e06ceff033d509ad5b37c6fc087413b672f1afcfc00fd902f624eeeaf
Contents?: true
Size: 851 Bytes
Versions: 6
Compression:
Stored size: 851 Bytes
Contents
module Mongoid #:nodoc: module Extensions #:nodoc: module Hash #:nodoc: module Assimilation #:nodoc: # Introduces a child object into the +Document+ object graph. This will # set up the relationships between the parent and child and update the # attributes of the parent +Document+. # # Options: # # parent: The +Document+ to assimilate into. # options: The association +Options+ for the child. # # Example: # # <tt>{:first_name => "Hank", :last_name => "Moody"}.assimilate(name, options)</tt> # # Returns: The child +Document+. def assimilate(parent, options) klass = options.klass child = klass.instantiate(self) child.assimilate(parent, options) end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems