Module: AdvancedRelationshipManagement::CycleDetection
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/advanced_relationship_management/cycle_detection.rb
Instance Method Summary collapse
Instance Method Details
#no_cycles ⇒ Object
9 10 11 12 13 |
# File 'lib/advanced_relationship_management/cycle_detection.rb', line 9 def no_cycles if ancestors.include?(self) errors.add(:base, "Cycle detected in the hierarchy") end end |