Method: Mongoid::Relations::Metadata#cascade_strategy

Defined in:
lib/mongoid/relations/metadata.rb

#cascade_strategyObject

Returns the name of the strategy used for handling dependent relations.

Examples:

Get the strategy.

.cascade_strategy

Returns:

  • (Object)

    The cascading strategy to use.

Since:

  • 2.0.0.rc.1



96
97
98
99
100
# File 'lib/mongoid/relations/metadata.rb', line 96

def cascade_strategy
  if dependent?
    "Mongoid::Relations::Cascading::#{dependent.to_s.classify}".constantize
  end
end