stefankroes / ancestry

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

[4.3.x] Deprecate adding ancestry to the middle of an STI tree #625

Closed kbrock closed 1 year ago

kbrock commented 1 year ago

Added deprecation warnings for has_ancestry in the middle of an STI tree.


Still haven't thought up a good use case for why someone would define ancestry in the middle of an STI tree.

Due to the way it was introduce, it is possible that allowing has_ancestry in the middle of the tree was not an explicit goal but a side effect.

This warning will go into 4.3.x. Unsure if we will drop this functionality in 5.0 or 6.0.

The test helper has an implicit has_ancestry at the top level so it was masking the intent of the test. Whether we deprecate the feature or not, it is best to get this test into the code.

NOTE: as follow up, need to add deprecation for #617 but it looks like that may be invasive. may want to backport that PR and tweak it