Module: Mongoid::Relations::Cascading
- Extended by:
- ActiveSupport::Concern
- Included in:
- Mongoid::Relations
- Defined in:
- lib/mongoid/relations/cascading.rb,
lib/mongoid/relations/cascading/delete.rb,
lib/mongoid/relations/cascading/destroy.rb,
lib/mongoid/relations/cascading/nullify.rb,
lib/mongoid/relations/cascading/restrict.rb
Overview
This module defines the behaviour for setting up cascading deletes and nullifies for relations, and how to delegate to the approriate strategy.
Defined Under Namespace
Modules: ClassMethods Classes: Delete, Destroy, Nullify, Restrict
Instance Method Summary collapse
-
#cascade! ⇒ Object
Perform all cascading deletes, destroys, or nullifies.
Instance Method Details
#cascade! ⇒ Object
Perform all cascading deletes, destroys, or nullifies. Will delegate to the appropriate strategy to perform the operation.
27 28 29 30 31 32 33 34 |
# File 'lib/mongoid/relations/cascading.rb', line 27 def cascade! cascades.each do |name| if = relations[name] strategy = .cascade_strategy strategy.new(self, ).cascade if strategy end end end |