Class: Mongoid::Relations::Cascading::Nullify

Inherits:
Strategy show all
Defined in:
lib/mongoid/relations/cascading/nullify.rb

Instance Attribute Summary

Attributes inherited from Strategy

#document, #metadata, #relation

Instance Method Summary collapse

Methods inherited from Strategy

#initialize

Constructor Details

This class inherits a constructor from Mongoid::Relations::Cascading::Strategy

Instance Method Details

#cascadeObject

This cascade does not delete the referenced relations, but instead sets the foreign key values to nil.

Examples:

Nullify the reference.

strategy.cascade


12
13
14
# File 'lib/mongoid/relations/cascading/nullify.rb', line 12

def cascade
  relation.nullify if relation
end