Module Ancestry::InstanceMethods
In: lib/ancestry/instance_methods.rb

Methods

Constants

BEFORE_LAST_SAVE_SUFFIX = ActiveRecord::VERSION::STRING >= '5.1.0' ? '_before_last_save' : '_was'
IN_DATABASE_SUFFIX = ActiveRecord::VERSION::STRING >= '5.1.0' ? '_in_database' : '_was'
ANCESTRY_DELIMITER = '/'.freeze

Public Instance methods

deprecated - probably don‘t want to use anymore

Ancestors

Validate that the ancestors don‘t include itself

Apply orphan strategy (before destroy - no changes)

The ancestry value for this record‘s children (before save) This is technically child_ancestry_was

childless?()

Alias for is_childless?

children?()

Alias for has_children?

has_parent?()

Alias for ancestors?

only_child?()

Alias for is_only_child?

currently parent= does not work in after save callbacks assuming that parent hasn‘t changed

root?()

Alias for is_root?

siblings?()

Alias for has_siblings?

Touch each of this record‘s ancestors (after save)

Update descendants with new ancestry (before save)

[Validate]