Module: Mongoid::Extensions::Object::Parentization

Included in:
Object
Defined in:
lib/mongoid/extensions/object/parentization.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#parentize(object, association_name) ⇒ Object

Sets the parent object



6
7
8
9
10
# File 'lib/mongoid/extensions/object/parentization.rb', line 6

def parentize(object, association_name)
  self.parent = object
  self.association_name = association_name
  add_observer(object)
end