stefankroes / ancestry

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

Rename internal methods names to be more rails consistent #652

Closed kbrock closed 1 year ago

kbrock commented 1 year ago

Don't think these methods are used by extension developers.

Did not rename child_ancestry => child_ancestry_in_database. I went back and forth on this one. I put in a note to hopefully help anyone confused by the code using _in_database.

Now throwing an error from child_ancestry_before_last_save for newly saved records. (rails >= 6.1) This error is thrown if this scope is used from an after_save hook on a new record. Either change the hook to an after_update or guard with a previously_new_record?. Throwing an error because for new records, this value may point to root and bad things could happen.