stefankroes / ancestry

Organise ActiveRecord model into a tree structure
MIT License
3.71k stars 458 forks source link

Support overriding apply_orphan_strategy #632

Closed kbrock closed 1 year ago

kbrock commented 1 year ago

apply_orphan_strategy was removed in #617 Many gems override this method to apply a custom orphan strategy

This adds support back and adds a test around the behavior

breaking change:

If a developer calls super() from apply_orphan_strategy, it will no longer work. Fix: directly call the desired strategy apply_orphan_strategy_* instead