stefankroes / ancestry

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

Drop touch and ancestry_primary_key_format #649

Closed kbrock closed 1 year ago

kbrock commented 1 year ago

These parameters are passed into has_ancestry and consumed by it.

This is part of a trend to drop many of the exposed/class level configuration parameters in ancestry.

touch

Before

we referenced touch to determine if we should touch fields

After

We do not install the callbacks unless we want the touch behavior. Variable is now no longer needed.

ancestry_primary_key_format

Before

This was recently introduced in 3.4 and is a mechanism for passing the key format into the format class (e.g.: materialized_path) to determine the regular expression used for validation

After

It is being passed into the format and no longer referenced via the class level variable. It no longer needs to be an exposed.

kbrock commented 1 year ago

updates:

Since we were modifying touch, I had added tests here. Decided to put those into #650 so the tests can be applied to 3-4 and master